Recognition method and device of close-up air-environment shot, storage medium and electronic equipment

Through the two-stage recognition method, the combination of the front-end model and the large close-up sky model solves the problem of traditional algorithms being unable to recognize close-up sky shots, achieving efficient recognition and improved accuracy.

CN118675087AActive Publication Date: 2024-09-20BEIJING IQIYI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410835526.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-20
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

Traditional algorithms cannot effectively identify close-up aerial shots, resulting in increased manual screening workload and cost consumption.

Method used

A two-stage recognition method is adopted. First, the close-up space footage in the target video is initially screened through the trained front-end model, and then it is input into the trained close-up space model for further recognition, and the front-end model and the close-up space are integrated. Identification results of large models to determine final results.

Benefits of technology

It effectively reduces the time-consuming algorithm reasoning, reduces the memory usage, reduces the cost, improves the processing efficiency and improves the recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675087A
    Figure CN118675087A
Patent Text Reader

Abstract

The invention relates to a close-up air-environment shot identification method and device, a storage medium and electronic equipment. The method comprises the following steps: acquiring all shot segments of a target video, and extracting a shot image of each frame of each shot segment; inputting all the shot images into a trained front model to obtain a first recognition result of each shot segment; the target shot images of all the first shot segments are input into a trained close-up air-environment large model, a second recognition result of each first shot segment is obtained, the first shot segments are shot segments with the first recognition result being close-up air-environment shots, and the second shot segments are shot segments with the second recognition result being close-up air-environment shots. The target lens images are a plurality of lens images extracted from all lens images of the corresponding lens segments; and under the condition that the second identification result of the second shot fragment is the close-up air-environment shot, determining that the second shot fragment is the close-up air-environment shot. The technical problem that a traditional algorithm cannot effectively recognize a close-up empty lens is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of empty shot algorithm recognition, and in particular to a close-up empty shot recognition method, device, storage medium and electronic device. Background Art

[0002] In the empty shot algorithm recognition business, there is a type of close-up shot that is mainly used to highlight the close-up details of animals, objects, environments, buildings, etc. It is necessary to effectively identify this type of close-up empty shot to reduce the workload and cost of manual screening. However, since close-up empty shots belong to a type of shot language and are relatively abstract, traditional algorithms cannot directly use convolutional networks to extract features from them and cannot cover all categories, so they cannot effectively identify close-up empty shots. Summary of the invention

[0003] The present application provides a close-up empty shot recognition method, device, storage medium and electronic device to solve the technical problem that traditional algorithms cannot effectively recognize close-up empty shots.

[0004] In a first aspect, the present application provides a method for identifying close-up empty shots, comprising: obtaining all shot segments of a target video, and extracting the lens image of each frame of each shot segment; inputting all the lens images into a trained pre-model to obtain a first recognition result for each of the above-mentioned shot segments, wherein the above-mentioned first recognition result includes close-up empty shots and non-close-up empty shots; inputting the target lens images of all the first shot segments into a trained close-up empty model to obtain a second recognition result for each of the first shot segments, wherein the above-mentioned first shot segment is a shot segment whose first recognition result is a close-up empty shot, the target lens image is a plurality of lens images extracted from all lens images of the corresponding shot segment, and the above-mentioned second recognition result includes close-up empty shots and non-close-up empty shots; when the above-mentioned second recognition result of the second shot segment is a close-up empty shot, determining the above-mentioned second shot segment as a close-up empty shot, wherein the above-mentioned second shot segment is any shot segment among all the first shot segments.

[0005] In a second aspect, the present application provides a device for identifying close-up empty shots, comprising: a first acquisition module, used to acquire all shot segments of a target video, and extract the lens image of each frame of each shot segment; a first recognition module, used to input all the lens images into a trained pre-model, and obtain a first recognition result for each of the above-mentioned shot segments, wherein the above-mentioned first recognition result includes close-up empty shots and non-close-up empty shots; a second recognition module, used to input the target lens images of all the first shot segments into a trained close-up empty model, and obtain a second recognition result for each of the first shot segments, wherein the above-mentioned first shot segment is a shot segment whose first recognition result is a close-up empty shot, the target lens image is a plurality of lens images extracted from all lens images of the corresponding shot segment, and the above-mentioned second recognition result includes close-up empty shots and non-close-up empty shots; a determination module, used to determine that the above-mentioned second shot segment is a close-up empty shot when the above-mentioned second recognition result of the second shot segment is a close-up empty shot, wherein the above-mentioned second shot segment is any shot segment among all the first shot segments.

[0006] As an optional example, the first acquisition module includes: an acquisition unit for acquiring the target video; a reading unit for reading the target video frame by frame, detecting and marking the shot positions of the target video; and a segmentation unit for segmenting the target video into a plurality of shot segments according to the shot positions, wherein each shot segment is composed of video frames between two consecutive shot positions.

[0007] As an optional example, the above-mentioned device also includes: a second acquisition module, used to obtain the above-mentioned trained close-up empty space large model and the first training data set before inputting all lens images into the trained front-end model to obtain the first recognition result of each of the above-mentioned lens segments; a first processing module, used to input the above-mentioned first training data set into the above-mentioned trained close-up empty space large model, so that the above-mentioned trained close-up empty space large model performs data cleaning and classification on the above-mentioned first training data set to obtain a close-up empty space lens training data set and a non-close-up empty space lens training data set; a training module, used to use the above-mentioned close-up empty space lens training data set and the above-mentioned non-close-up empty space lens training data set to train the front-end model to obtain the above-mentioned trained front-end model.

[0008] As an optional example, the above-mentioned device also includes: an adding module, which is used to add a low-rank matrix decomposition layer in the close-up empty space large model before obtaining the above-mentioned trained close-up empty space large model; a third acquisition module, which is used to obtain a second training data set and an input prompt, and input the above-mentioned second training data set and the above-mentioned input prompt into the close-up empty space large model to obtain a prediction result data set; a calculation module, which is used to calculate the loss value based on the above-mentioned second training data set and the above-mentioned prediction result data set; an updating module, which is used to update the parameters of the above-mentioned low-rank matrix decomposition layer according to the above-mentioned loss value to obtain the trained close-up empty space large model.

[0009] As an optional example, the first recognition module includes: a first processing unit, used to determine each shot segment of all shot segments as the current shot segment, and perform the following operations on the current shot segment: perform close-up empty image prediction on each lens image of the current shot segment to determine whether each lens image is a close-up empty image; count a first number of all lens images of the current shot segment, and a second number of close-up empty images in the current shot segment; divide the second number by the first number to obtain a first close-up empty image ratio of the current shot segment; when the first close-up empty image ratio is greater than or equal to a first target threshold, determine that the first recognition result of the current shot segment is a close-up empty shot; when the first close-up empty image ratio is less than the first target threshold, determine that the first recognition result of the current shot segment is a non-close-up empty shot.

[0010] As an optional example, the above-mentioned device also includes: a second processing module, which is used to input the target lens images of all first lens fragments into the trained close-up empty space large model to obtain the second recognition result of each first lens fragment, determine each first lens fragment of all first lens fragments as the current lens fragment, and perform the following operations on the above-mentioned current lens fragment: divide the above-mentioned current lens fragment into a plurality of partial lens fragments on average; extract a frame of lens image from each partial lens fragment respectively, and obtain the target lens image of the above-mentioned current lens fragment.

[0011] As an optional example, the second recognition module includes: a second processing unit, used to determine each first shot segment of all first shot segments as a current shot segment, and perform the following operations on the current shot segment: perform close-up empty space image prediction on each target lens image of the current shot segment to determine whether each target lens image is a close-up empty space image; count the third number of all target lens images of the current shot segment, and the fourth number of close-up empty space images among all target lens images; divide the fourth number by the third number to obtain the second close-up empty space image ratio of the current shot segment; when the second close-up empty space image ratio is greater than or equal to the second target threshold, determine that the second recognition result of the current shot segment is a close-up empty space shot; when the second close-up empty space image ratio is less than the second target threshold, determine that the second recognition result of the current shot segment is a non-close-up empty space shot.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned close-up empty shot recognition method when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned close-up empty shot recognition method through the computer program.

[0014] In an embodiment of the present application, all shot segments of a target video are obtained, and the lens image of each frame of each shot segment is extracted; all the lens images are input into a trained pre-model to obtain a first recognition result for each of the above-mentioned shot segments, wherein the first recognition result includes a close-up empty shot and a non-close-up empty shot; the target lens images of all the first shot segments are input into a trained close-up empty shot large model to obtain a second recognition result for each of the first shot segments, wherein the first shot segment is a shot segment whose first recognition result is a close-up empty shot, the target lens image is a plurality of lens images extracted from all the lens images of the corresponding shot segment, and the second recognition result includes a close-up empty shot and a non-close-up empty shot; in the second recognition result of the second shot segment If it is a close-up empty shot, the method for determining that the above-mentioned second shot segment is a close-up empty shot, wherein the above-mentioned second shot segment is any shot segment of all the first shot segments. In the above method, the shot segments of close-up empty shots in the input target video are first preliminarily screened through the trained front model, and then, the shot segments identified as close-up empty shots based on the trained front model are input into the trained close-up empty model to determine whether it is a close-up empty shot. Finally, the recognition results of the trained front model and the trained close-up empty model are integrated to obtain the final recognition result, thereby achieving the purpose of effectively reducing the algorithm reasoning time, reducing the memory usage, reducing the cost, and improving the processing efficiency, thereby solving the technical problem that the traditional algorithm cannot effectively identify the close-up empty shot. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1 is a flow chart of an optional method for identifying a close-up empty shot according to an embodiment of the present application;

[0019] Figure 2This is a flow chart of a pre-model training of an optional method for recognizing close-up empty space shots according to an embodiment of the present application;

[0020] Figure 3 It is a close-up empty space large model training flow chart of an optional close-up empty space shot recognition method according to an embodiment of the present application;

[0021] Figure 4 is an overall implementation flow chart of an optional method for identifying a close-up empty space shot according to an embodiment of the present application;

[0022] Figure 5 is a schematic structural diagram of an optional device for identifying a close-up empty space shot according to an embodiment of the present application;

[0023] Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0025] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0026] According to a first aspect of an embodiment of the present application, a method for identifying a close-up empty scene is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0027] S102, acquiring all shot segments of the target video, and extracting a shot image of each frame of each shot segment;

[0028] S104, inputting all the shot images into the trained pre-model to obtain a first recognition result for each shot segment, wherein the first recognition result includes a close-up empty shot and a non-close-up empty shot;

[0029] S106, inputting the target lens images of all first lens segments into the trained close-up empty space large model to obtain a second recognition result for each first lens segment, wherein the first lens segment is a lens segment whose first recognition result is a close-up empty space lens, the target lens image is a plurality of lens images extracted from all lens images of the corresponding lens segment, and the second recognition result includes a close-up empty space lens and a non-close-up empty space lens;

[0030] S108, when the second recognition result of the second shot segment is a close-up empty shot, determine that the second shot segment is a close-up empty shot, wherein the second shot segment is any shot segment among all the first shot segments.

[0031] Optionally, in this embodiment, the pre-model can be a convolutional neural network model (CNN), which is mainly used in the fields of image and video recognition, image classification, image analysis, etc. Large-scale language model (LLM) refers to a deep learning model with a large number of parameters that can process and generate natural language text. It understands and generates natural language text with consistent grammar and semantics by training massive text data. The trained close-up empty space large model is a model obtained by fine-tuning some parameters of the large-scale language model in the LoRA method. LoRA (Low-Rank Adaptation) is a method for efficiently fine-tuning large-scale pre-trained models, which reduces the amount of parameters that need to be updated through low-rank matrix decomposition, thereby reducing computing resources and storage requirements.

[0032] Optionally, in this embodiment, an existing shot segmentation algorithm or tool is used to identify different shot transition points in the target video, and the target video is segmented into multiple shot segments. Each frame in the shot segment is traversed to extract the shot image of each frame of each shot segment. These extracted shot images are input into a trained front-end model, and the front-end model is responsible for preliminarily classifying these frames to obtain a first recognition result for each shot segment. The first recognition result will classify the shot segment as a "close-up empty shot" or a "non-close-up empty shot". For the shot segments preliminarily identified as "close-up empty shots" by the front-end model, multiple target shot images are extracted from each of these shot segments. These target shot images are key frames selected from the corresponding shot segments or several frames uniformly extracted. The extracted target shot images are input into a trained close-up empty shot large model, and the close-up empty shot large model will further classify and identify these target shot images to obtain a second recognition result for each shot segment, that is, whether the shot segments corresponding to these target shot images are "close-up empty shots". If the second recognition result indicates that a certain shot segment is recognized as a “close-up empty shot”, the shot segment is finally determined to be a “close-up empty shot”.

[0033] Optionally, in this embodiment, the accuracy of recognition can be improved through a two-stage recognition process (pre-model and close-up empty space large model). The pre-model is responsible for preliminary screening, and the close-up empty space large model performs fine classification. The pre-model can quickly filter out a large number of irrelevant lens fragments and only analyze potential close-up empty space lens fragments in detail, thereby improving the overall processing efficiency. And the above method makes full use of all frame image information in the target video to ensure that the recognition result is comprehensive and accurate.

[0034] Optionally, in this embodiment, the lens segments of close-up empty shots in the input target video are preliminarily screened through the trained front model, and then the lens segments identified as close-up empty shots based on the trained front model are input into the trained close-up empty model to determine whether they are close-up empty shots. Finally, the recognition results of the trained front model and the trained close-up empty model are fused to obtain the final recognition result, thereby effectively reducing the algorithm reasoning time, reducing video memory usage, reducing costs, and improving processing efficiency, thereby solving the technical problem that traditional algorithms cannot effectively identify close-up empty shots.

[0035] As an optional example, obtaining all shot segments of a target video includes:

[0036] Get the target video;

[0037] Read the target video frame by frame, detect and mark the lens points of the target video;

[0038] According to the shot positions, the target video is divided into multiple shot segments, where each shot segment is composed of video frames between two consecutive shot positions.

[0039] Optionally, in this embodiment, in order to obtain all the shot segments of the target video, it is necessary to detect and mark the shot points of the target video, and then divide the target video into multiple shot segments according to the shot points. Shot points, also known as scene switching points, are the transition points from one shot to another in a video. The method for detecting shot points can be by calculating the color histogram difference of adjacent frames, and when the difference exceeds a certain threshold, it is marked as a shot point. Specifically, each frame of the image is read from the target video, and each frame can be analyzed by reading frame by frame. Once the shot point is detected, it is marked, and the frame number or timestamp is recorded to indicate that the point is a shot switching point. According to the marked shot points, the target video is divided into multiple shot segments, and each shot segment is composed of video frames between two consecutive shot points. For example, if the shot points are frame 1, frame 50, and frame 100, respectively, the video can be divided into two segments of frame 1 to frame 50 and frame 51 to frame 100.

[0040] Optionally, in this embodiment, the shot switching points can be accurately identified through frame-by-frame analysis and detection, achieving high-precision video segmentation, which greatly facilitates subsequent video analysis and processing.

[0041] As an optional example, before inputting all the lens images into the trained pre-model to obtain the first recognition result of each lens segment, the method further includes:

[0042] Obtain a trained close-up empty space large model and a first training data set;

[0043] Inputting the first training data set into the trained close-up empty space large model, so that the trained close-up empty space large model performs data cleaning and classification on the first training data set to obtain a close-up empty space lens training data set and a non-close-up empty space lens training data set;

[0044] The front-end model is trained using the close-up empty space shot training data set and the non-close-up empty space shot training data set to obtain a trained front-end model.

[0045] Optionally, in this embodiment, before all lens images are input into the trained pre-model to obtain the first recognition result of each lens segment, the pre-model needs to be trained based on the trained close-up empty space large model and the massive first training data set to obtain the trained pre-model. Figure 2The front-end model training flowchart shown uses the trained close-up empty space large model to clean the first training data set that includes a large amount of online data to achieve the purpose of classifying and labeling empty shot images, and uses the classified close-up empty space shot training data set to train the front-end model. The front-end model adds a cross-attention mechanism after feature extraction to improve the feature representation capability and complete the front-end model training.

[0046] As an optional example, before obtaining the trained close-up empty space model, the method further includes:

[0047] Added low-rank matrix factorization layer to the close-up empty space large model;

[0048] Obtain a second training data set and an input prompt, and input the second training data set and the input prompt into the close-up empty space large model to obtain a prediction result data set;

[0049] Calculate the loss value based on the second training data set and the prediction result data set;

[0050] The parameters of the low-rank matrix decomposition layer are updated according to the loss value to obtain the trained close-up empty space large model.

[0051] Optionally, in this embodiment, before using the trained close-up empty space large model to train the pre-model, it is necessary to train the close-up empty space large model to obtain the trained close-up empty space large model. Fine-tune the large-scale language model, that is, the close-up empty space large model, and use the LoRA method to fine-tune the close-up empty space large model. Using the LoRA method to fine-tune the model can reduce the amount of data annotation and the cost of data annotation. Only a small batch of data and a second training data set are needed to achieve a good recognition effect. LoRA (Low-Rank Adaptation) is a method for efficiently fine-tuning large-scale pre-trained models. It reduces the amount of parameters that need to be updated through low-rank matrix decomposition, thereby reducing computing resources and storage requirements. Specifically, if Figure 3 As shown in the training flowchart of the close-up empty space large model, the training process uses the LoRA method to fine-tune only some parameters of the close-up empty space large model, for example, fine-tune about 30% of the parameters. The prompt format input during fine-tuning is as follows: {"instruct i on":"The above is an image I input. Please judge whether it is a building. You only need to answer 'It is a building' or 'It is not a building'","output":"It is a building"}. Through fine-tuning, a large-scale language model exclusive to close-up empty shots can be obtained.

[0052] Optionally, in this embodiment, a low-rank matrix decomposition layer is inserted at an appropriate position of the close-up empty space large model. In this way, the original weight matrix will be decomposed into the product of two low-rank matrices, reducing the number of parameters. The second training data set and the input prompt are input into the close-up empty space large model together. The model processes these inputs and generates a prediction result data set. Using the loss function, the difference between the model prediction result data set and the actual label is calculated. According to the loss value, the gradient is calculated by the back propagation algorithm, and the parameters of the low-rank matrix decomposition layer are updated. After multiple iterative training, the parameters of the low-rank matrix decomposition layer are continuously optimized, and finally a trained close-up empty space large model is obtained.

[0053] As an optional example, all lens images are input into the trained front-end model, and the first recognition result of each lens segment is obtained, including:

[0054] Determine each shot clip of all shot clips as the current shot clip, and perform the following operations on the current shot clip:

[0055] Perform close-up empty space image prediction on each lens image of the current lens segment to determine whether each lens image is a close-up empty space image;

[0056] Counting a first number of all lens images in the current lens segment, and a second number of close-up empty space images in the current lens segment;

[0057] Dividing the second number by the first number, to obtain the first close-up empty space image ratio of the current shot segment;

[0058] When the proportion of the first close-up empty space image is greater than or equal to the first target threshold, determining that the first recognition result of the current shot segment is a close-up empty space shot;

[0059] When the proportion of the first close-up empty space image is less than the first target threshold, it is determined that the first recognition result of the current shot segment is a non-close-up empty space shot.

[0060] Optionally, in this embodiment, all lens images are input into the trained pre-model to obtain the first recognition result of each lens segment. Taking a lens segment as an example, the specific process is to input each lens image frame in the lens segment into the trained pre-model. For each lens image frame, the model outputs a prediction result to determine whether the lens image is a close-up empty space image. The number of all lens images in the lens segment is counted, which is recorded as the first number, which is the total number of frames contained in the lens segment. The number of images predicted to be close-up empty space images in the lens segment is counted, which is recorded as the second number. The ratio of the second number to the first number is calculated, that is, the first close-up empty space image ratio. This ratio represents the proportion of close-up empty space images in the lens segment. The calculated first close-up empty space image ratio is compared with a pre-set first target threshold. If the ratio is greater than or equal to the first target threshold, the first recognition result of the lens segment is determined to be a close-up empty space lens. If the ratio is less than the first target threshold, the first recognition result of the lens segment is determined to be a non-close-up empty space lens. The first recognition results of all lens segments are obtained by the above method.

[0061] Optionally, in this embodiment, by predicting the close-up empty space image frame by frame and judging the category of the entire shot segment by counting the percentage, the accuracy and reliability of recognition can be improved. By calculating the percentage instead of judging a single frame, noise and accidental errors can be effectively resisted, and the robustness of the model in practical applications can be improved.

[0062] As an optional example, before inputting the target lens images of all first lens segments into the trained close-up empty space large model to obtain the second recognition result of each first lens segment, the method further includes:

[0063] Each first shot clip of all first shot clips is determined as the current shot clip, and the following operations are performed on the current shot clip:

[0064] Divide the current shot segment into multiple partial shot segments evenly;

[0065] A frame of lens image is extracted from each partial lens segment to obtain the target lens image of the current lens segment.

[0066] Optionally, in this embodiment, multiple target lens images are extracted from each lens segment of all first lens segments as recognition data input to the trained close-up empty space model. Taking a certain lens segment as an example, the entire lens segment is divided into multiple partial lens segments. Assuming that the lens segment contains N frames, it is evenly divided into K segments, and the frame A of each segment is calculated as N / K (rounded down). For the last partial lens segment, if the number of frames cannot be divided by K, it may contain slightly more or less frames to ensure that all frames are included. In each partial lens segment, a frame of lens image is selected as a representative. There can be multiple strategies for this, such as: extracting the middle frame of the partial lens segment; extracting the first frame or the last frame of the partial lens segment; randomly extracting any frame in the partial lens segment. The frame image set extracted from each partial lens segment constitutes the target lens image of this lens segment. Assuming that this lens segment is divided into K segments, the target lens image set will contain K images.

[0067] Optionally, in this embodiment, by dividing the entire shot segment into a plurality of partial shot segments and extracting frame images therefrom, the diversity and changes in the shot segment can be better captured, ensuring that the selected images are more representative. Extracting only a small number of frame images for subsequent processing greatly reduces the computational burden and improves processing efficiency compared to processing all frames of the entire shot segment.

[0068] As an optional example, the target lens images of all first lens segments are input into the trained close-up empty space large model, and the second recognition result of each first lens segment is obtained, including:

[0069] Each first shot clip of all first shot clips is determined as the current shot clip, and the following operations are performed on the current shot clip:

[0070] Perform close-up empty space image prediction on each target lens image of the current lens segment to determine whether each target lens image is a close-up empty space image;

[0071] Counting a third number of all target lens images in the current lens segment, and a fourth number of close-up empty space images among all target lens images;

[0072] Dividing the fourth number by the third number, the ratio of the second close-up empty space image of the current shot segment is obtained;

[0073] When the proportion of the second close-up empty space image is greater than or equal to the second target threshold, determining that the second recognition result of the current shot segment is a close-up empty space shot;

[0074] When the proportion of the second close-up empty space image is less than the second target threshold, it is determined that the second recognition result of the current shot segment is a non-close-up empty space shot.

[0075] Optionally, in this embodiment, the target lens images of all first lens segments are input into the trained close-up empty space model to obtain the second recognition result of each first lens segment. Taking a certain first lens segment as an example, the specific process is to input each target lens image in this lens segment into the trained close-up empty space model. The model classifies each target lens image to determine whether it is a close-up empty space image. For each target lens image, the prediction result of the model is recorded (close-up empty space image or not close-up empty space image). The number of all target lens images in this first lens segment is counted, recorded as the third number, which is the total number of target images extracted in this first lens segment. The number of target lens images predicted to be close-up empty space images in this first lens segment is counted, recorded as the fourth number. The ratio of the fourth number to the third number is calculated, that is, the proportion of the second close-up empty space image. This ratio represents the proportion of the close-up empty space image in this first lens segment. Compare the calculated second close-up empty space image ratio with a preset second target threshold. If the ratio is greater than or equal to the second target threshold, determine that the second recognition result of the first shot segment is a close-up empty space shot. If the ratio is less than the second target threshold, determine that the second recognition result of the first shot segment is a non-close-up empty space shot.

[0076] To illustrate with an example, in order to solve the problem that traditional algorithms cannot effectively identify abstract categories such as close-up empty shots, this application proposes a method for identifying close-up empty shots, which uses the powerful generalization ability of large-scale language models to identify close-up empty shots in videos, greatly improving the algorithm's recall and reducing the algorithm's false detection, thereby improving the algorithm's recognition accuracy as a whole. By combining the full amount of data with the trained pre-model and the partial data with the trained large close-up empty model, it is possible to ensure the inference speed and meet the business needs while integrating the recognition results of the small-scale pre-model and the large model, improving the algorithm's recognition accuracy and effectively reducing false detections.

[0077] The specific implementation steps are as follows Figure 4 The overall implementation flow chart shown:

[0078] Step 1: Input the entire video, detect and mark the camera positions of the video, and then divide the video into multiple camera segments according to the camera positions;

[0079] Step 2: input each frame of lens images of all lens clips into the trained pre-model to obtain a first recognition result of whether each lens clip is a close-up empty shot, including: judging whether each lens image in each lens clip is a close-up empty image, calculating the proportion of the first close-up empty image in each lens clip, setting a suitable first target threshold, and if the proportion of the first close-up empty image exceeds the first target threshold, the lens clip is considered to be a close-up empty shot;

[0080] Step 3: Based on the screened close-up empty shot segments, randomly select a number of frames, generally one frame each from the front, middle, and back of the shot segment in terms of time distribution, and input them into the trained close-up empty space large model to obtain a second recognition result of whether each shot segment is a close-up empty space shot;

[0081] Step 4: Fusion the first recognition result and the second recognition result. Only when the first recognition result and the second recognition result are consistent, the shot segment is a true close-up empty shot, and all close-up empty shots are output.

[0082] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0083] According to another aspect of the embodiment of the present application, a device for identifying a close-up empty scene is also provided. Figure 5 As shown, including:

[0084] A first acquisition module 502 is used to acquire all shot segments of a target video and extract a shot image of each frame of each shot segment;

[0085] A first recognition module 504 is used to input all shot images into the trained pre-model to obtain a first recognition result for each shot segment, wherein the first recognition result includes a close-up empty shot and a non-close-up empty shot;

[0086] The second recognition module 506 is used to input the target lens images of all the first lens segments into the trained close-up empty space large model to obtain a second recognition result of each first lens segment, wherein the first lens segment is a lens segment whose first recognition result is a close-up empty space lens, the target lens image is a plurality of lens images extracted from all lens images of the corresponding lens segment, and the second recognition result includes a close-up empty space lens and a non-close-up empty space lens;

[0087] The determination module 508 is configured to determine that the second shot segment is a close-up empty shot when the second recognition result of the second shot segment is a close-up empty shot, wherein the second shot segment is any shot segment among all the first shot segments.

[0088] Optionally, in this embodiment, the pre-model can be a convolutional neural network model (CNN), which is mainly used in the fields of image and video recognition, image classification, image analysis, etc. Large-scale language model (LLM) refers to a deep learning model with a large number of parameters that can process and generate natural language text. It understands and generates natural language text with consistent grammar and semantics by training massive text data. The trained close-up empty space large model is a model obtained by fine-tuning some parameters of the large-scale language model in the LoRA method. LoRA (Low-Rank Adaptation) is a method for efficiently fine-tuning large-scale pre-trained models, which reduces the amount of parameters that need to be updated through low-rank matrix decomposition, thereby reducing computing resources and storage requirements.

[0089] Optionally, in this embodiment, an existing shot segmentation algorithm or tool is used to identify different shot transition points in the target video, and the target video is segmented into multiple shot segments. Each frame in the shot segment is traversed to extract the shot image of each frame of each shot segment. These extracted shot images are input into a trained front-end model, and the front-end model is responsible for preliminarily classifying these frames to obtain a first recognition result for each shot segment. The first recognition result will classify the shot segment as a "close-up empty shot" or a "non-close-up empty shot". For the shot segments preliminarily identified as "close-up empty shots" by the front-end model, multiple target shot images are extracted from each of these shot segments. These target shot images are key frames selected from the corresponding shot segments or several frames uniformly extracted. The extracted target shot images are input into a trained close-up empty shot large model, and the close-up empty shot large model will further classify and identify these target shot images to obtain a second recognition result for each shot segment, that is, whether the shot segments corresponding to these target shot images are "close-up empty shots". If the second recognition result indicates that a certain shot segment is recognized as a “close-up empty shot”, the shot segment is finally determined to be a “close-up empty shot”.

[0090] Optionally, in this embodiment, the accuracy of recognition can be improved through a two-stage recognition process (pre-model and close-up empty space large model). The pre-model is responsible for preliminary screening, and the close-up empty space large model performs fine classification. The pre-model can quickly filter out a large number of irrelevant lens fragments and only analyze potential close-up empty space lens fragments in detail, thereby improving the overall processing efficiency. And the above method makes full use of all frame image information in the target video to ensure that the recognition result is comprehensive and accurate.

[0091] Optionally, in this embodiment, the lens segments of close-up empty shots in the input target video are preliminarily screened through the trained front model, and then the lens segments identified as close-up empty shots based on the trained front model are input into the trained close-up empty model to determine whether they are close-up empty shots. Finally, the recognition results of the trained front model and the trained close-up empty model are fused to obtain the final recognition result, thereby effectively reducing the algorithm reasoning time, reducing video memory usage, reducing costs, and improving processing efficiency, thereby solving the technical problem that traditional algorithms cannot effectively identify close-up empty shots.

[0092] As an optional example, the first acquisition module includes:

[0093] An acquisition unit, used for acquiring a target video;

[0094] A reading unit, used to read the target video frame by frame, detect and mark the lens points of the target video;

[0095] The segmentation unit is used to segment the target video into multiple shot segments according to the shot points, wherein each shot segment is composed of video frames between two consecutive shot points.

[0096] Optionally, in this embodiment, in order to obtain all the shot segments of the target video, it is necessary to detect and mark the shot points of the target video, and then divide the target video into multiple shot segments according to the shot points. Shot points, also known as scene switching points, are the transition points from one shot to another in a video. The method for detecting shot points can be by calculating the color histogram difference of adjacent frames, and when the difference exceeds a certain threshold, it is marked as a shot point. Specifically, each frame of the image is read from the target video, and each frame can be analyzed by reading frame by frame. Once the shot point is detected, it is marked, and the frame number or timestamp is recorded to indicate that the point is a shot switching point. According to the marked shot points, the target video is divided into multiple shot segments, and each shot segment is composed of video frames between two consecutive shot points. For example, if the shot points are frame 1, frame 50, and frame 100, respectively, the video can be divided into two segments of frame 1 to frame 50 and frame 51 to frame 100.

[0097] Optionally, in this embodiment, the shot switching points can be accurately identified through frame-by-frame analysis and detection, achieving high-precision video segmentation, which greatly facilitates subsequent video analysis and processing.

[0098] As an optional example, the device further includes:

[0099] The second acquisition module is used to acquire the trained close-up empty space model and the first training data set before inputting all lens images into the trained pre-model to obtain the first recognition result of each lens segment;

[0100] A first processing module is used to input the first training data set into the trained close-up empty space large model, so that the trained close-up empty space large model performs data cleaning and classification on the first training data set to obtain a close-up empty space shot training data set and a non-close-up empty space shot training data set;

[0101] The training module is used to train the front-end model using the close-up empty space shot training data set and the non-close-up empty space shot training data set to obtain a trained front-end model.

[0102] Optionally, in this embodiment, before all lens images are input into the trained pre-model to obtain the first recognition result of each lens segment, the pre-model needs to be trained based on the trained close-up empty space large model and the massive first training data set to obtain the trained pre-model. Figure 2 The front-end model training flowchart shown uses the trained close-up empty space large model to clean the first training data set that includes a large amount of online data to achieve the purpose of classifying and labeling empty shot images, and uses the classified close-up empty space shot training data set to train the front-end model. The front-end model adds a cross-attention mechanism after feature extraction to improve the feature representation capability and complete the front-end model training.

[0103] As an optional example, the device further includes:

[0104] Add a module for adding a low-rank matrix factorization layer to the close-up empty space large model before obtaining the trained close-up empty space large model;

[0105] A third acquisition module is used to acquire a second training data set and an input prompt, and input the second training data set and the input prompt into the close-up empty space large model to obtain a prediction result data set;

[0106] A calculation module, used for calculating a loss value according to the second training data set and the prediction result data set;

[0107] The update module is used to update the parameters of the low-rank matrix decomposition layer according to the loss value to obtain the trained close-up empty space large model.

[0108] Optionally, in this embodiment, before using the trained close-up empty space large model to train the pre-model, it is necessary to train the close-up empty space large model to obtain the trained close-up empty space large model. Fine-tune the large-scale language model, that is, the close-up empty space large model, and use the LoRA method to fine-tune the close-up empty space large model. Using the LoRA method to fine-tune the model can reduce the amount of data annotation and the cost of data annotation. Only a small batch of data and a second training data set are needed to achieve a good recognition effect. LoRA (Low-Rank Adaptation) is a method for efficiently fine-tuning large-scale pre-trained models. It reduces the amount of parameters that need to be updated through low-rank matrix decomposition, thereby reducing computing resources and storage requirements. Specifically, if Figure 3 As shown in the training flowchart of the close-up empty space large model, the training process uses the LoRA method to fine-tune only some parameters of the close-up empty space large model, for example, fine-tune about 30% of the parameters. The prompt format input during fine-tuning is as follows: {"instruct i on":"The above is an image I input. Please judge whether it is a building. You only need to answer 'It is a building' or 'It is not a building'","output":"It is a building"}. Through fine-tuning, a large-scale language model exclusive to close-up empty shots can be obtained.

[0109] Optionally, in this embodiment, a low-rank matrix decomposition layer is inserted at an appropriate position of the close-up empty space large model. In this way, the original weight matrix will be decomposed into the product of two low-rank matrices, reducing the number of parameters. The second training data set and the input prompt are input into the close-up empty space large model together. The model processes these inputs and generates a prediction result data set. Using the loss function, the difference between the model prediction result data set and the actual label is calculated. According to the loss value, the gradient is calculated by the back propagation algorithm, and the parameters of the low-rank matrix decomposition layer are updated. After multiple iterative training, the parameters of the low-rank matrix decomposition layer are continuously optimized, and finally a trained close-up empty space large model is obtained.

[0110] As an optional example, the first identification module includes:

[0111] The first processing unit is used to determine each shot segment of all shot segments as a current shot segment, and perform the following operations on the current shot segment:

[0112] Perform close-up empty space image prediction on each lens image of the current lens segment to determine whether each lens image is a close-up empty space image;

[0113] Counting a first number of all lens images in the current lens segment, and a second number of close-up empty space images in the current lens segment;

[0114] Dividing the second number by the first number, to obtain the first close-up empty space image ratio of the current shot segment;

[0115] When the proportion of the first close-up empty space image is greater than or equal to the first target threshold, determining that the first recognition result of the current shot segment is a close-up empty space shot;

[0116] When the proportion of the first close-up empty space image is less than the first target threshold, it is determined that the first recognition result of the current shot segment is a non-close-up empty space shot.

[0117] Optionally, in this embodiment, all lens images are input into the trained pre-model to obtain the first recognition result of each lens segment. Taking a lens segment as an example, the specific process is to input each lens image frame in the lens segment into the trained pre-model. For each lens image frame, the model outputs a prediction result to determine whether the lens image is a close-up empty space image. The number of all lens images in the lens segment is counted, which is recorded as the first number, which is the total number of frames contained in the lens segment. The number of images predicted to be close-up empty space images in the lens segment is counted, which is recorded as the second number. The ratio of the second number to the first number is calculated, that is, the first close-up empty space image ratio. This ratio represents the proportion of close-up empty space images in the lens segment. The calculated first close-up empty space image ratio is compared with a pre-set first target threshold. If the ratio is greater than or equal to the first target threshold, the first recognition result of the lens segment is determined to be a close-up empty space lens. If the ratio is less than the first target threshold, the first recognition result of the lens segment is determined to be a non-close-up empty space lens. The first recognition results of all lens segments are obtained by the above method.

[0118] Optionally, in this embodiment, by predicting the close-up empty space image frame by frame and judging the category of the entire shot segment by counting the percentage, the accuracy and reliability of recognition can be improved. By calculating the percentage instead of judging a single frame, noise and accidental errors can be effectively resisted, and the robustness of the model in practical applications can be improved.

[0119] As an optional example, the device further includes:

[0120] The second processing module is used to input the target lens images of all the first lens segments into the trained close-up empty space large model to obtain the second recognition result of each first lens segment, determine each first lens segment of all the first lens segments as the current lens segment, and perform the following operations on the current lens segment:

[0121] Divide the current shot segment into multiple partial shot segments evenly;

[0122] A frame of lens image is extracted from each partial lens segment to obtain the target lens image of the current lens segment.

[0123] Optionally, in this embodiment, multiple target lens images are extracted from each lens segment of all first lens segments as recognition data input to the trained close-up empty space model. Taking a certain lens segment as an example, the entire lens segment is divided into multiple partial lens segments. Assuming that the lens segment contains N frames, it is evenly divided into K segments, and the frame A of each segment is calculated as N / K (rounded down). For the last partial lens segment, if the number of frames cannot be divided by K, it may contain slightly more or less frames to ensure that all frames are included. In each partial lens segment, a frame of lens image is selected as a representative. There can be multiple strategies for this, such as: extracting the middle frame of the partial lens segment; extracting the first frame or the last frame of the partial lens segment; randomly extracting any frame in the partial lens segment. The frame image set extracted from each partial lens segment constitutes the target lens image of this lens segment. Assuming that this lens segment is divided into K segments, the target lens image set will contain K images.

[0124] Optionally, in this embodiment, by dividing the entire shot segment into a plurality of partial shot segments and extracting frame images therefrom, the diversity and changes in the shot segment can be better captured, ensuring that the selected images are more representative. Extracting only a small number of frame images for subsequent processing greatly reduces the computational burden and improves processing efficiency compared to processing all frames of the entire shot segment.

[0125] As an optional example, the second identification module includes:

[0126] The second processing unit is used to determine each first shot segment of all first shot segments as a current shot segment, and perform the following operations on the current shot segment:

[0127] Perform close-up empty space image prediction on each target lens image of the current lens segment to determine whether each target lens image is a close-up empty space image;

[0128] Counting a third number of all target lens images in the current lens segment, and a fourth number of close-up empty space images among all target lens images;

[0129] Dividing the fourth number by the third number, the ratio of the second close-up empty space image of the current shot segment is obtained;

[0130] When the proportion of the second close-up empty space image is greater than or equal to the second target threshold, determining that the second recognition result of the current shot segment is a close-up empty space shot;

[0131] When the proportion of the second close-up empty space image is less than the second target threshold, it is determined that the second recognition result of the current shot segment is a non-close-up empty space shot.

[0132] Optionally, in this embodiment, the target lens images of all first lens segments are input into the trained close-up empty space model to obtain the second recognition result of each first lens segment. Taking a certain first lens segment as an example, the specific process is to input each target lens image in this lens segment into the trained close-up empty space model. The model classifies each target lens image to determine whether it is a close-up empty space image. For each target lens image, the prediction result of the model is recorded (close-up empty space image or not close-up empty space image). The number of all target lens images in this first lens segment is counted, recorded as the third number, which is the total number of target images extracted in this first lens segment. The number of target lens images predicted to be close-up empty space images in this first lens segment is counted, recorded as the fourth number. The ratio of the fourth number to the third number is calculated, that is, the proportion of the second close-up empty space image. This ratio represents the proportion of the close-up empty space image in this first lens segment. Compare the calculated second close-up empty space image ratio with a preset second target threshold. If the ratio is greater than or equal to the second target threshold, determine that the second recognition result of the first shot segment is a close-up empty space shot. If the ratio is less than the second target threshold, determine that the second recognition result of the first shot segment is a non-close-up empty space shot.

[0133] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0134] Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 6 As shown, it includes a processor 602, a communication interface 604, a memory 606 and a communication bus 608, wherein the processor 602, the communication interface 604 and the memory 606 communicate with each other through the communication bus 608, wherein,

[0135] Memory 606, used to store computer programs;

[0136] The processor 602 is used to implement the following steps when executing the computer program stored in the memory 606:

[0137] Obtain all the lens clips of the target video and extract the lens image of each frame of each lens clip;

[0138] Input all the shot images into the trained pre-model to obtain a first recognition result for each shot segment, wherein the first recognition result includes a close-up empty shot and a non-close-up empty shot;

[0139] Input the target lens images of all first lens segments into the trained close-up empty space large model to obtain the second recognition result of each first lens segment, wherein the first lens segment is a lens segment whose first recognition result is a close-up empty space lens, the target lens image is a plurality of lens images extracted from all lens images of the corresponding lens segment, and the second recognition result includes a close-up empty space lens and a non-close-up empty space lens;

[0140] When the second recognition result of the second shot segment is a close-up empty shot, the second shot segment is determined to be a close-up empty shot, wherein the second shot segment is any shot segment among all the first shot segments.

[0141] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The communication interface is used for communication between the above electronic device and other devices.

[0142] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0143] As an example, the memory 606 may include, but is not limited to, the first acquisition module 502, the first recognition module 504, the second recognition module 506, and the determination module 508 in the close-up empty-frame shot recognition device. In addition, it may also include, but is not limited to, other module units in the close-up empty-frame shot recognition device, which will not be repeated in this example.

[0144] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0145] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0146] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only, and the device for implementing the above-mentioned close-up empty space shot recognition method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations shown.

[0147] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0148] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned close-up empty shot recognition method when executed by a processor.

[0149] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0150] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0151] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0152] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0153] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0154] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0156] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for identifying close-up empty space shots, characterized in that: include: Obtain all the lens clips of the target video and extract the lens image of each frame of each lens clip; Input all the shot images into the trained pre-model to obtain a first recognition result for each shot segment, wherein the first recognition result includes a close-up empty shot and a non-close-up empty shot; Inputting the target lens images of all first lens segments into the trained close-up empty space large model, obtaining a second recognition result of each first lens segment, wherein the first lens segment is a lens segment whose first recognition result is a close-up empty space lens, the target lens image is a plurality of lens images extracted from all lens images of the corresponding lens segment, and the second recognition result includes a close-up empty space lens and a non-close-up empty space lens; When the second recognition result of the second shot segment is a close-up empty shot, the second shot segment is determined to be a close-up empty shot, wherein the second shot segment is any shot segment among all the first shot segments.

2. The method according to claim 1, characterized in that The method of obtaining all the shot segments of the target video includes: Acquire the target video; Read the target video frame by frame, and detect and mark the shot points of the target video; According to the shot positions, the target video is divided into a plurality of shot segments, wherein each shot segment is composed of video frames between two consecutive shot positions.

3. The method according to claim 1, characterized in that Before inputting all the lens images into the trained pre-model to obtain the first recognition result of each lens segment, the method further includes: Obtaining the trained close-up empty space large model and a first training data set; Inputting the first training data set into the trained close-up empty space large model, so that the trained close-up empty space large model performs data cleaning and classification on the first training data set to obtain a close-up empty space shot training data set and a non-close-up empty space shot training data set; The front-end model is trained using the close-up empty space shot training data set and the non-close-up empty space shot training data set to obtain the trained front-end model.

4. The method according to claim 3, characterized in that Before obtaining the trained close-up empty space large model, the method further includes: Added low-rank matrix factorization layer to the close-up empty space large model; Obtaining a second training data set and an input prompt, and inputting the second training data set and the input prompt into the close-up empty space large model to obtain a prediction result data set; Calculate the loss value according to the second training data set and the prediction result data set; The parameters of the low-rank matrix decomposition layer are updated according to the loss value to obtain a trained close-up empty space large model.

5. The method according to claim 1, characterized in that Inputting all the lens images into the trained pre-model to obtain the first recognition result of each lens segment includes: Each shot segment of all shot segments is determined as a current shot segment, and the following operations are performed on the current shot segment: Performing close-up empty space image prediction on each lens image of the current lens segment to determine whether each lens image is a close-up empty space image; Counting a first number of all lens images in the current lens segment, and a second number of close-up empty space images in the current lens segment; Dividing the second number by the first number to obtain a first close-up empty space image ratio of the current shot segment; When the proportion of the first close-up empty space image is greater than or equal to a first target threshold, determining that the first recognition result of the current shot segment is a close-up empty space shot; When the proportion of the first close-up empty space image is less than the first target threshold, it is determined that the first recognition result of the current shot segment is a non-close-up empty space shot.

6. The method according to claim 1, characterized in that Before inputting the target shot images of all first shot segments into the trained close-up empty space large model to obtain the second recognition result of each first shot segment, the method further includes: Determine each first shot segment of all first shot segments as a current shot segment, and perform the following operations on the current shot segment: Dividing the current shot segment into multiple partial shot segments on average; A frame of lens image is extracted from each partial lens segment to obtain a target lens image of the current lens segment.

7. The method according to claim 1, characterized in that The step of inputting the target lens images of all first lens segments into the trained close-up empty space large model to obtain the second recognition result of each first lens segment includes: Determine each first shot segment of all first shot segments as a current shot segment, and perform the following operations on the current shot segment: Performing close-up empty space image prediction on each target lens image of the current lens segment to determine whether each target lens image is a close-up empty space image; Counting a third number of all target shot images of the current shot segment, and a fourth number of close-up empty space images among all target shot images; Dividing the fourth number by the third number to obtain a ratio of the second close-up empty space image of the current shot segment; When the proportion of the second close-up empty space image is greater than or equal to a second target threshold, determining that the second recognition result of the current shot segment is a close-up empty space shot; When the proportion of the second close-up empty space image is less than the second target threshold, it is determined that the second recognition result of the current shot segment is a non-close-up empty space shot.

8. A device for identifying close-up empty space shots, characterized in that: include: The first acquisition module is used to acquire all the shot segments of the target video and extract the shot image of each frame of each shot segment; A first recognition module is used to input all shot images into a trained pre-model to obtain a first recognition result for each shot segment, wherein the first recognition result includes a close-up empty shot and a non-close-up empty shot; A second recognition module is used to input the target lens images of all first lens segments into the trained close-up empty space large model to obtain a second recognition result of each first lens segment, wherein the first lens segment is a lens segment whose first recognition result is a close-up empty space lens, the target lens image is a plurality of lens images extracted from all lens images of the corresponding lens segment, and the second recognition result includes a close-up empty space lens and a non-close-up empty space lens; The determination module is used to determine that the second shot segment is a close-up empty shot when the second recognition result of the second shot segment is a close-up empty shot, wherein the second shot segment is any shot segment among all the first shot segments.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Sports video lens classification method based on deep convolutional neural networks

    CN105955708A

  • Empty mirror material identification method and device, terminal and storage medium

    CN114758274A

  • Image recognition method and device and computer readable medium

    CN117372749A

  • Device for classifying and device for log generating sports video

    JP2006251885A

  • Data Recognition in Content

    US20130322765A1