Video identification method, device and equipment

By determining and updating the video frames in the video information list, the problems that the memory occupies the goal in multiple target scenarios is easy to discard, and the efficient utilization of memory and the stable recognition of the target.

CN119360257APending Publication Date: 2025-01-24SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310916248.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In multi-target scenarios, existing video recognition algorithms lead to large memory usage and targets are easily discarded.

Method used

By determining the first video frame and the second video frame in the video information list, the video information list is updated according to the quality difference value of the optimal target, reducing the number of video frames and releasing memory.

Benefits of technology

Effectively reduce memory usage, avoid the abandonment of targets caused by insufficient memory, reduce the number of previous reports, and improve the efficiency of resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004359874650000051
    Figure BDA0004359874650000051
  • Figure BDA0004359874650000061
    Figure BDA0004359874650000061
  • Figure BDA0004359874650000071
    Figure BDA0004359874650000071
Patent Text Reader

Abstract

The invention provides a video identification method, device and equipment. The video identification method provided by the invention comprises the steps of determining a first video frame from a video information list under the condition that the residual capacity of the video information list is smaller than a preset capacity; the number of optimal targets contained in the first video frame is a first specified value; determining a second video frame corresponding to each optimal target in the video information list according to the target information of each optimal target contained in the first video frame, and deleting the video information of the first video frame from the video information list under the condition that the video information list comprises the second video frame corresponding to each optimal target, and updating the video information of the second video frame corresponding to each optimal target, so that the second video frame corresponding to each optimal target is used as the optimal video frame. According to the video identification method, device and equipment provided by the invention, the usage amount of the memory can be reduced, and the phenomenon that the target is discarded due to insufficient memory space is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a video recognition method, device and equipment. Background Art

[0002] With the improvement of computer performance and the development of image processing technology, visual recognition algorithms have developed rapidly. Visual recognition algorithms process and analyze visual information such as images and videos, extract features such as target objects and contours, and achieve the purpose of automatic recognition and classification.

[0003] The existing video recognition algorithm tracks the target from the time the target appears to the time the target disappears, continuously compares the target's quality score during the tracking process, and saves the recognition result with the highest quality score.

[0004] When there are a large number of targets in the monitoring scene, the optimal result for each target may exist on different video frames, which requires a large amount of memory. If the memory is limited, it is easy for the target to be discarded due to insufficient memory space. Summary of the invention

[0005] In view of this, the present application provides a video recognition method, apparatus and device to solve the problems of large memory usage and easy loss of targets in multi-target scenarios.

[0006] Specifically, the present application is implemented through the following technical solutions:

[0007] The first aspect of the present application provides a video recognition method, the method comprising:

[0008] In the case where the remaining capacity of the video information list is less than the preset capacity, determining a first video frame from the video information list; wherein the number of best targets included in the first video frame is a first specified value;

[0009] Determine, in the video information list, a second video frame corresponding to each of the best targets according to the target information of each of the best targets contained in the first video frame; wherein a difference between a quality score of each of the best targets in the first video frame and a quality score of each of the best targets in the second video frame is less than a preset threshold;

[0010] In the case where there is a second video frame corresponding to each of the best targets in the video information list, the video information of the first video frame is deleted from the video information list, and the video information of the second video frame corresponding to each of the best targets is updated so that the second video frame corresponding to each of the best targets serves as the best video frame.

[0011] A second aspect of the present application provides a video recognition device, the device comprising a determination module and a processing module; wherein:

[0012] The determining module is used to determine a first video frame from the video information list when the remaining capacity of the video information list is less than a preset capacity; wherein the number of best targets included in the first video frame is a first specified value;

[0013] The determination module is also used to determine the second video frame corresponding to each best target in the video information list according to the target information of each best target contained in the first video frame; wherein the difference between the quality score of each best target in the first video frame and the quality score of each best target in the second video frame is less than a preset threshold.

[0014] The processing module is used to delete the video information of the first video frame from the video information list and update the video information of the second video frame corresponding to each of the best targets when the video information list includes the second video frame corresponding to each of the best targets, so that the second video frame corresponding to each of the best targets is used as the best video frame.

[0015] The third aspect of the present application provides a video recognition device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the methods provided in the first aspect of the present application are implemented.

[0016] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods provided in the first aspect of the present application.

[0017] The video recognition method, device and equipment provided by the present application, when the remaining capacity of the video information list is less than the preset capacity, by determining the first video frame from the video information list; wherein the number of the best targets contained in the first video frame is a first specified value, and according to the target information of each best target contained in the first video frame, the second video frame corresponding to each of the best targets is determined in the video information list; wherein the difference between the quality score of each of the best targets in the first video frame and the quality score of each of the best targets in the second video frame is less than the preset threshold, and then when the video information list includes the second video frame corresponding to each of the best targets, the video information of the first video frame is deleted from the video information list, and the video information of the second video frame corresponding to each of the best targets is updated, so that the second video frame corresponding to each of the best targets is used as the best video frame. In this way, for the video frame containing the first specified number of best targets, the best target can be replaced by selecting a target close to the best target, and the video frame with only the first specified number of best targets can be released, thereby reducing the number of video frames, thereby reducing the memory usage, and avoiding the phenomenon that the target is discarded due to insufficient memory space. In addition, since the number of video frames in the video information list is reduced, the number of reports can also be reduced, reducing resource overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of the first embodiment of the video recognition method provided by this application;

[0019] Figure 2 A flowchart of Embodiment 2 of the video recognition method provided in this application;

[0020] Figure 3 A flowchart of Embodiment 3 of the video recognition method provided in this application;

[0021] Figure 4 A flowchart of a fourth embodiment of the video recognition method provided by the present application;

[0022] Figure 5 A flowchart of Embodiment 5 of the video recognition method provided in this application;

[0023] Figure 6 A hardware structure diagram of a video recognition device in which the video recognition device provided in this application is located;

[0024] Figure 7 A schematic diagram of the structure of the video recognition device embodiment 1 provided in this application;

[0025] Figure 8 This is a structural diagram of Embodiment 2 of the video recognition device provided in this application. DETAILED DESCRIPTION

[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0027] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0028] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0029] The present application provides a video recognition method, apparatus and device to solve the problems of large memory usage and easy loss of targets in multi-target scenarios.

[0030] The video recognition method, device and apparatus provided by the present application, when the remaining capacity of the video information list is less than the preset capacity, by determining the first video frame from the video information list; wherein the number of the best targets contained in the first video frame is a first specified value, and according to the target information of each of the best targets contained in the first video frame, the second video frame corresponding to each of the best targets is determined in the video information list; wherein the difference between the quality score of each of the best targets in the first video frame and the quality score of each of the best targets in the second video frame is less than the preset threshold, and then, when the second video frame corresponding to each of the best targets exists in the video information list, the video information of the first video frame is deleted from the video information list, and the video information of the second video frame corresponding to each of the best targets is updated, so that the second video frame corresponding to each of the best targets is used as the best video frame. In this way, for the video frame containing the first specified number of best targets, the best target can be replaced by selecting a target close to the best target, and the video frame containing only the first specified number of best targets can be released, thereby reducing the number of video frames, thereby reducing the memory usage, and avoiding the phenomenon that the target is discarded due to insufficient memory space. In addition, since the number of video frames in the video information list is reduced, the number of reports can also be reduced, thereby reducing resource overhead.

[0031] Specific embodiments are given below to introduce the technical solution of the present application in detail.

[0032] Figure 1 This is a flow chart of the first embodiment of the video recognition method provided by this application. Please refer to Figure 1 , the method provided in this embodiment may include:

[0033] S101. When the remaining capacity of the video information list is less than a preset capacity, determine a first video frame from the video information list; wherein the number of optimal targets included in the first video frame is a first specified value.

[0034] Specifically, the preset capacity is set according to actual needs, and in this embodiment, the specific value of the preset capacity is not limited. For example, in one embodiment, the preset capacity is 5 frames.

[0035] Furthermore, the video information list records the video information of each identified video frame, wherein the video information of each video frame includes the sequence number of the video frame, the data of the video frame, the first list corresponding to all targets detected by the video frame, and the second list corresponding to the best target contained in the video frame.

[0036] It should be noted that the best target contained in a video frame refers to the target with the video frame as the best video frame among all the targets detected in the video frame.

[0037] For example, in one embodiment, the video information list records the video information of the 1st video frame, the 3rd video frame, the 5th video frame, and the 7th video frame in video 1. Accordingly, for the video information of the 1st video frame, the video information may include the following contents: the sequence number of the 1st video frame, the data of the 1st video frame, the first list corresponding to all targets detected by the first video frame, and the second list corresponding to the best target contained in the first video frame. For example, in one embodiment, all targets detected by the 1st video frame recorded in the first list include: target A, target B, target C, and the best target contained in the 1st video frame recorded in the second list includes: target A.

[0038] In combination with the above example, for example, Table 1 is a video information list shown in an exemplary embodiment of the present application:

[0039] Table 1 Video information list

[0040]

[0041]

[0042] It should be noted that in this step, the currently used capacity of the video information list can be obtained, and then the remaining capacity of the video information list is calculated based on the maximum capacity and used capacity pre-set for the video information list, and then it is determined whether the remaining capacity is less than the preset capacity.

[0043] Furthermore, the maximum capacity pre-set for the video information list is set according to actual needs, and is not limited in this embodiment. For example, in one embodiment, the maximum capacity pre-set for the video information list is 20 frames.

[0044] In combination with the above example, for example, in one embodiment, the used capacity is 4 frames, and the remaining capacity is calculated to be 16 frames. At this time, it is determined that the remaining capacity is not less than the preset capacity.

[0045] For another example, in another embodiment, the used capacity is 16 frames, and the remaining capacity is calculated to be 4 frames. At this time, it is determined that the remaining capacity is less than the preset capacity.

[0046] Specifically, the first specified value is set according to actual needs, and in this embodiment, the specific value of the first specified value is not limited. For example, in one embodiment, the first specified value is 1, and in this case, in this step, the first video frame containing 1 best target is searched from the video information list.

[0047] Combined with Table 1, after searching, it is determined that the first video frame contains one optimal target (target A). At this time, the first video frame is the first video frame found.

[0048] S102. Determine, in the video information list, a second video frame corresponding to each of the best targets according to the target information of each of the best targets contained in the first video frame; wherein a difference between a quality score of each of the best targets in the first video frame and a quality score of each of the best targets in the second video frame is less than a preset threshold.

[0049] Specifically, the video recognition device records a target information list, which records the target information of each detected target, and the target information of each target includes the identification information of the target, the highest quality score of the target, the identification information of the best video frame (the target has the highest quality score in this frame of video) and a video frame list; wherein the video frame list records the identification information of each frame of video that includes the target and the quality score of the target in each frame of video.

[0050] It should be noted that the highest quality score of the target refers to the highest value of the quality score of the target in each video frame.

[0051] In addition, in one embodiment, the quality score of the target in each video frame may be the quality score output by the recognition model when the video frame is recognized; in another embodiment, the quality score of the target in each video frame may also be a comprehensive quality score calculated based on the size information, position information and confidence value of the target output by the recognition model after the video frame is recognized. This is not limited in this embodiment.

[0052] For example, in one embodiment, the target information list is shown in Table 2:

[0053] Table 2 Target information list

[0054]

[0055] In specific implementation, for each best target, it is possible to first search from the video information list whether there is a target video frame containing the best target. If not, it is directly determined that the video information list does not contain a second video frame corresponding to the best target. If so, it is further determined whether the difference between the video score of the best target in the first video frame and its quality score in the target video frame is less than a preset threshold. If so, it is determined that there is a second video frame corresponding to the best target, and the target video frame is determined to be the second video frame corresponding to the best target. If not, it is determined that there is no second video frame corresponding to the best target.

[0056] It should be noted that the preset threshold is set according to actual needs, and in this embodiment, the specific value of the preset threshold is not limited. For example, in one embodiment, the preset threshold is 10.

[0057] Combining Table 1 and Table 2, the difference between the quality score of target A in the first video frame and the quality score of target A in the seventh video frame is less than the preset threshold, and the seventh video frame is the second video frame corresponding to target A.

[0058] S103. When the video information list includes the second video frame corresponding to each of the best targets, delete the video information of the first video frame from the video information list, and update the video information of the second video frame corresponding to each of the best targets so that the second video frame corresponding to each of the best targets serves as the best video frame.

[0059] In specific implementation, in this step, the best target is added to the second list in the video information of the second video frame, so that the best target uses the second video frame as the best video frame. Combined with the above example, the updated video information of the 7th video frame is as follows: sequence number: 7, data: data 7, first list: A, B, C, second list: A, B, C.

[0060] The video recognition method provided in this embodiment, when the remaining capacity of the video information list is less than the preset capacity, determines the first video frame from the video information list, wherein the number of the best targets contained in the first video frame is a first specified value, and determines the second video frame corresponding to each of the best targets in the video information list according to the target information of each best target contained in the first video frame; wherein the difference between the quality score of each of the best targets in the first video frame and the quality score of each of the best targets in the second video frame is less than the preset threshold, and then when the video information list includes the second video frame corresponding to each of the best targets, the video information of the first video frame is deleted from the video information list, and the video information of the second video frame corresponding to each of the best targets is updated, so that the second video frame corresponding to each of the best targets is used as the best video frame. In this way, for the video frame containing the first specified number of best targets, the best target can be replaced by selecting a target close to the best target, and the video frame containing only the first specified number of best targets can be released, thereby reducing the number of video frames, thereby reducing the memory usage, and avoiding the phenomenon that the target is discarded due to insufficient memory space. In addition, since the data of the video information in the video information list is reduced, the number of reports can also be reduced, and resource overhead can be reduced.

[0061] Figure 2 This is a flow chart of the second embodiment of the video recognition method provided by this application. Please refer to Figure 2 The method provided in this embodiment, based on the above embodiment, further includes:

[0062] S201. When a preset cleaning condition is met, search for a third video frame from the video information list; wherein the number of best targets included in the third video frame is a second specified value.

[0063] Specifically, in this embodiment, the second specified value is 0.

[0064] Specifically, the preset cleaning condition is set according to actual needs, and in this embodiment, the specific content of the preset cleaning condition is not limited. For example, in a possible implementation, the preset cleaning condition may be that no new target is detected within a first preset time period; for another example, in another possible implementation, the preset cleaning condition may be that when detecting and tracking a certain video frame, a target is detected, but the target does not use the video frame as the best video frame.

[0065] It should be noted that the first preset duration is set according to actual needs. In this embodiment, the specific value of the first preset duration is not limited. For example, in one embodiment, the first preset duration is 10 seconds. At this time, when no new target is detected for 10 consecutive seconds, a video frame with the best target number of 0 is searched from the video information list.

[0066] S202: Delete the video information of the third video frame from the video information list.

[0067] Combined with Table 1, when the first preset time length is 10 seconds, when no new target is detected for 10 consecutive seconds, at this time, the third video frame with the number of best targets being 0 is searched from the video information list, and the third video frames found are the 3rd video frame and the 5th video frame. At this time, the video information of the 3rd video frame and the 5th video frame is deleted from the video information list.

[0068] The video recognition method provided in this embodiment, when the preset cleaning condition is met, searches for a third video frame from the video information list; wherein the number of the best targets contained in the third video frame is the second specified value, and then deletes the video information of the third video frame from the video information list. In this way, the video information corresponding to the useless video frames can be cleaned up in time, further releasing the memory, and avoiding the phenomenon that the target is discarded due to insufficient memory space.

[0069] Optionally, after deleting the video information of the first video frame from the video information list, the method further includes:

[0070] When a preset uploading condition is met, determining a fourth video frame with the earliest recording time in the video information queue;

[0071] First event information is generated according to the video information of the fourth video frame, and the first event information is added to an event upload queue.

[0072] Specifically, the preset upload condition is set according to actual needs, and in this embodiment, the specific content of the preset upload condition is not limited. For example, in a possible implementation, the preset upload condition is that the remaining capacity of the video information list is less than the second preset threshold value, so that the target can be reported in advance to clear space in advance to save the new target.

[0073] It should be noted that the second preset threshold is set according to actual needs. In this embodiment, the specific value of the second preset threshold is not limited. Preferably, the second preset threshold is less than the preset capacity. For example, in one embodiment, the second preset threshold is 3 frames.

[0074] For another example, in another possible implementation, the preset upload condition is that no new target is detected within the second preset time. In this way, when no new target is detected for a long time, the remaining target can be forced to be reported.

[0075] It should be noted that the second preset time length is set according to actual needs. In this embodiment, the specific value of the second preset time length is not limited.

[0076] The video recognition method provided in this embodiment, when the preset upload condition is met, determines the fourth video frame with the earliest recording time in the video information queue, generates first event information according to the video information of the fourth video frame, and adds the first event information to the event upload queue. In this way, when the preset upload condition is met, the target can be reported and the memory can be released in advance.

[0077] Figure 3 This is a flow chart of Embodiment 3 of the video recognition method provided by this application. The method provided by this embodiment may include:

[0078] S301. Determine whether the event upload queue is empty. If so, execute step S302. If not, execute step S308.

[0079] S302: When any one of the preset switching conditions is met, determine a target working mode corresponding to the currently met switching condition according to the preset correspondence between the switching condition and the working mode, and switch to the target working mode.

[0080] Specifically, the working mode refers to the working mode of the video recognition device, which includes a multi-target working mode and a few-target working mode.

[0081] Furthermore, the preset switching condition is set according to actual needs, and in this embodiment, the specific content of the preset switching condition is not limited. For example, in one embodiment, the preset switching condition includes that the capacity of the video information list is less than the third preset threshold (wherein the third preset threshold is less than the preset capacity), or the number of targets detected within the third preset duration is less than the preset value. It should be noted that the third preset threshold, the third preset duration, and the preset value are all set according to actual needs, and in this embodiment, they are not limited.

[0082] The correspondence between the pre-set switching conditions and working modes is: when the switching condition is that the capacity of the video information list is less than the third preset threshold, the corresponding working mode is the multi-target working mode; when the switching condition is that the number of targets detected within the third preset time length is less than the preset value, the corresponding working mode is the few-target working mode.

[0083] In this way, when the switching condition currently met is that the capacity of the video information list is less than the third preset threshold, the video recognition device switches to the multi-target working mode; and when the switching condition currently met is that the number of targets detected within the third preset time length is less than the preset value, the video recognition device switches to the few-target working mode.

[0084] It should be noted that when the video recognition device works in a few-target working mode, when it detects a disappeared target, it adds event information to the event upload queue (which will be introduced below and will not be repeated here).

[0085] Further, referring to the previous introduction, when the capacity of the video information list is less than the third preset threshold (wherein the third preset threshold is less than the preset capacity), the video recognition device switches to a multi-target working mode. Further, when the video recognition device works in the multi-target working mode, it adds event information to the event upload queue when the preset upload condition is met. Referring to the previous introduction, the preset upload condition is: no new target is detected within the second preset time length, or the preset upload condition is that the remaining capacity of the video information list is less than the second preset threshold (wherein the second preset threshold is less than the preset capacity). In other words, when the video recognition device works in the multi-target working mode, it can add event information to the event queue in advance and report the target in advance.

[0086] S303. When a preset cleaning condition is met, search for a third video frame from the video information list, and delete the video information of the third video frame from the video information list; wherein the number of best targets included in the third video frame is a second specified value.

[0087] The specific implementation process and implementation principle of step S303 can be referred to the description in the above embodiment, which will not be repeated here.

[0088] S304, determine whether the remaining capacity of the video information list is less than the preset capacity, if so, execute step S305, if not, execute step S308.

[0089] S305. Determine a first video frame from the video information list; wherein the number of best targets included in the first video frame is a first specified value.

[0090] S306. Determine, in the video information list, a second video frame corresponding to each of the best targets according to the target information of each of the best targets contained in the first video frame; wherein a difference between a quality score of each of the best targets in the first video frame and a quality score of each of the best targets in the second video frame is less than a preset threshold.

[0091] S307. When the video information list includes the second video frame corresponding to each of the best targets, delete the video information of the first video frame from the video information list, and update the video information of the second video frame corresponding to each of the best targets so that the second video frame corresponding to each of the best targets serves as the best video frame.

[0092] The specific implementation principles and implementation processes of steps S305 to S307 can be found in the description of the first embodiment, and will not be repeated here.

[0093] S308: Determine whether the preset upload conditions are met. If so, execute step S309; ​​if not, execute step S301.

[0094] S309: Determine a fourth video frame with the earliest recording time in the video information queue, generate first event information according to the video information of the fourth video frame, and add the first event information to an event upload queue.

[0095] Specifically, the specific implementation process and implementation principle of steps S308 and S309 can be referred to the description in the above embodiment, which will not be repeated here.

[0096] S310: Report the event information in the event upload queue, and delete the reported event information from the event upload queue.

[0097] The video recognition method provided in this embodiment can reduce the usage of memory and avoid the phenomenon that the target is lost due to insufficient memory. In addition, the number of reports can be reduced and the resource open source can be reduced.

[0098] Figure 4 This is a flowchart of the fourth embodiment of the video recognition method provided by this application. This embodiment involves the processing process of the first target that has disappeared. Please refer to Figure 4The method provided in this embodiment, based on the above embodiment, further includes:

[0099] S401. When detecting and tracking the fifth video frame currently being identified, if a first target that has disappeared is detected, determine whether the current working mode is a multi-target working mode. If so, execute step S405; if not, execute step S402.

[0100] For the specific implementation principle and process of detecting and tracking video frames, please refer to the description in the relevant technology, which will not be repeated here.

[0101] Specifically, the fifth video frame refers to the currently recognized video frame in the video to be recognized. In addition, the first target refers to the disappeared target. In specific implementation, for example, if a target has been detected before, if the target has not been detected for n consecutive frames, the target is determined to be a disappeared target. Among them, n is set according to actual needs. In this embodiment, the specific value of n is not limited. For example, in one embodiment, n is 3.

[0102] In addition, referring to the previous introduction, the working modes of the video recognition device include a multi-target working mode and a few-target working mode. This device records the current working mode, can obtain the current working mode, and then determine whether the current working mode is a multi-target working mode.

[0103] S402: Determine whether the event upload queue is full. If so, execute step S405; if not, execute step S403.

[0104] Referring to the previous introduction, whether the event upload queue is full can be determined based on the maximum capacity pre-set for the event upload queue and the used capacity currently used by the event upload queue. For example, if the used capacity currently used by the event upload queue is equal to the maximum capacity, then it is determined that the event upload queue is full.

[0105] S403: Determine whether the reported event involves the first target. If so, execute step S405; if not, execute step S404.

[0106] Specifically, the reported events will be recorded, and it can be determined whether the reported events involve the first target based on the records.

[0107] S404: Generate second event information according to the video information of the fifth video frame, and add the second event information to the event upload queue.

[0108] For the specific implementation principle of generating event information based on video information, please refer to the description in the relevant technology, which will not be repeated here.

[0109] S405: Ignore the first target.

[0110] It should be noted that ignoring the first target means not performing any processing on the first target.

[0111] The video recognition method provided in this embodiment, when detecting and tracking the fifth video frame currently being recognized, if a first target that has disappeared is detected, by judging whether the current working mode is a multi-target working mode, then ignoring the first target when the current working mode is a multi-target working mode, and when the current working mode is not a multi-target working mode, judging whether the event upload queue is full, then ignoring the first target when the event upload queue is full, and when the event upload queue is not full, when the reported event does not involve the first target, generating second event information based on the video information of the fifth video frame, and adding the second event information to the event upload queue. In this way, the first target can be processed based on the actual situation, thereby reducing the usage of memory and avoiding the phenomenon of target loss due to insufficient memory.

[0112] Figure 5 This is a flowchart of the fifth embodiment of the video recognition method provided by this application. This embodiment involves the processing process of the identified second target. Please refer to Figure 5 The method provided in this embodiment, based on the above embodiment, further includes:

[0113] S501. When detecting and tracking the sixth video frame currently being identified, if a second target is identified, determine whether the video information queue is full. If so, execute step S504; if not, execute step S502.

[0114] Specifically, the sixth video frame refers to the currently recognized video frame in the video to be recognized. The second target refers to the recognized target. In specific implementation, for example, when a target is detected in m consecutive frames, the target is determined as the recognized target. Among them, m is set according to actual needs. In this embodiment, the specific value of m is not limited. For example, in one embodiment, m is 3.

[0115] In addition, the specific implementation principle and process of detecting and tracking video frames can be referred to the description in the relevant technology, which will not be repeated here.

[0116] As described above, whether the video information queue is full can be determined based on the maximum capacity pre-set for the video information list and the used capacity currently used by the current video information list. For example, if the used capacity currently used by the video information list is equal to the maximum capacity, it is determined that the video information queue is full.

[0117] S502: Determine whether the reported event involves the second target. If so, execute step S504; if not, execute step S503.

[0118] Specifically, the reported events will be recorded, and it can be determined whether the reported events involve the second target based on the records.

[0119] S503: Add the target information corresponding to the second target to a target information list; wherein the target information list records the target information of each identified target.

[0120] Specifically, the specific implementation process of step S503 may include:

[0121] (1) Determine whether the second target is recorded in the target information list.

[0122] (2) If not, directly add the target information corresponding to the second target identified this time to the target information queue.

[0123] (3) If yes, determine whether the quality score of the target in the sixth video frame is higher based on the target information of the second target recorded in the target information queue and the target information of the second target identified this time; if not, discard the target information corresponding to the second target identified this time; if yes, update the target information of the second target recorded in the target information queue based on the target information corresponding to the second target identified this time.

[0124] Specifically, the specific implementation principles and implementation processes of steps (1) to (3) can be found in the description of the relevant technology and will not be repeated here.

[0125] S504: Ignore the second target.

[0126] It should be noted that ignoring the second target means not performing any processing on the second target.

[0127] The video recognition method provided in this embodiment, when detecting and tracking the sixth video frame currently being recognized, if a second target is recognized, by judging whether the video information queue is full, and then, when the video information queue is not full, judging whether the reported event involves the second target, and then, when the reported event does not involve the second target, adding the target information corresponding to the second target recognized this time to the target information list. In this way, the detected target can be processed based on the actual situation, thereby reducing the memory usage and avoiding the phenomenon of target loss due to insufficient memory.

[0128] Corresponding to the above-mentioned embodiment of the video recognition method, the present application also provides an embodiment of a video recognition device.

[0129] The embodiment of the video recognition device provided in this application can be applied to a video recognition device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the video recognition device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 6 As shown, it is a hardware structure diagram of the video recognition device provided by the present application where the video recognition device is located, except Figure 6 In addition to the processor, memory, network interface, and non-volatile memory shown, the video recognition device in the embodiment where the apparatus is located may also include other hardware according to the actual function of the video recognition device, which will not be described in detail.

[0130] Figure 7 For a schematic diagram of the structure of the video recognition device embodiment 1 provided in this application, please refer to Figure 7 , the device provided in this embodiment includes a determination module 710 and a processing module 720; wherein,

[0131] The determining module 710 is configured to determine a first video frame from the video information list when the remaining capacity of the video information list is less than a preset capacity; wherein the number of best targets included in the first video frame is a first specified value;

[0132] The determination module 710 is also used to determine the second video frame corresponding to each of the best targets in the video information list according to the target information of each of the best targets contained in the first video frame; wherein the difference between the quality score of each of the best targets in the first video frame and the quality score of each of the best targets in the second video frame is less than a preset threshold.

[0133] The processing module 720 is used to delete the video information of the first video frame from the video information list and update the video information of the second video frame corresponding to each of the best targets when the video information list includes the second video frame corresponding to each of the best targets, so that the second video frame corresponding to each of the best targets is used as the best video frame.

[0134] The device provided in this embodiment can be used to perform Figure 1 The technical method of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.

[0135] Optionally, the processing module 720 is also used to search for a third video frame from the video information list and delete the video information of the third video frame from the video information list when a preset cleaning condition is met; wherein the number of optimal targets contained in the third video frame is a second specified value.

[0136] Optionally, the processing module 720 is also used to determine the fourth video frame with the earliest recording time in the video information queue when a preset upload condition is met, generate first event information based on the video information of the fourth video frame, and add the first event information to the event upload queue.

[0137] Optionally, the processing module 720 is also used to determine the target working mode corresponding to the currently satisfied switching condition according to the correspondence between the preset switching condition and the working mode when any one of the preset switching conditions is satisfied, and switch to the target working mode.

[0138] Optional, Figure 8 For a structural diagram of the second embodiment of the video recognition device provided by this application, please refer to Figure 8 The device provided in this embodiment, based on the above embodiment, further includes an identification module 730, wherein:

[0139] The recognition module 730 is used to determine whether the current working mode is a multi-target working mode if a disappeared first target is detected when detecting and tracking the fifth video frame currently recognized;

[0140] The processing module 720 is also used to determine in the identification module 730 that the current working mode is a few-target working mode, and when the event upload queue is not full and the reported events do not involve the first target, generate second event information based on the video information of the fifth video frame and add the second event information to the event upload queue.

[0141] Optionally, the recognition module 730 is further configured to, when detecting and tracking the currently recognized sixth video frame, if a second target is recognized, determine whether the video information queue is full;

[0142] The processing module 720 is also used to determine in the identification module 730 that the video information queue is not full, and when the reported event does not involve the second target, add the target information corresponding to the second target to the target information list; wherein the target information list records the target information of each identified target.

[0143] Please continue to refer to Figure 6The present application also provides a video recognition device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the methods provided in the first aspect of the present application are implemented.

[0144] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of any one of the methods provided in the first aspect of the present application are implemented.

[0145] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A video recognition method, characterized in that: The method comprises: In the case where the remaining capacity of the video information list is less than the preset capacity, determining a first video frame from the video information list; wherein the number of best targets included in the first video frame is a first specified value; Determine, in the video information list, a second video frame corresponding to each of the best targets according to the target information of each of the best targets included in the first video frame; wherein a difference between a quality score of each of the best targets in the first video frame and a quality score of each of the best targets in the second video frame is less than a preset threshold; In the case where the video information list includes the second video frame corresponding to each of the best targets, the video information of the first video frame is deleted from the video information list, and the video information of the second video frame corresponding to each of the best targets is updated so that the second video frame corresponding to each of the best targets serves as the best video frame.

2. The method according to claim 1, characterized in that The method further comprises: When a preset cleaning condition is met, searching for a third video frame from the video information list; wherein the number of best targets contained in the third video frame is a second specified value; The video information of the third video frame is deleted from the video information list.

3. The method according to claim 1 or 2, characterized in that: After deleting the video information of the first video frame from the video information list, the method further includes: When a preset uploading condition is met, determining a fourth video frame with the earliest recording time in the video information queue; First event information is generated according to the video information of the fourth video frame, and the first event information is added to an event upload queue.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When any one of the preset switching conditions is met, a target working mode corresponding to the currently met switching condition is determined according to the correspondence between the preset switching condition and the working mode, and the target working mode is switched to.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When detecting and tracking the fifth video frame currently identified, if the disappeared first target is detected, determining whether the current working mode is a multi-target working mode; If not, when the event upload queue is not full and the reported event does not involve the first target, second event information is generated according to the video information of the fifth video frame, and the second event information is added to the event upload queue.

6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When detecting and tracking the sixth video frame currently being identified, if a second target is identified, determining whether the video information queue is full; If not, when the reported event does not involve the second target, the target information corresponding to the second target is added to a target information list; wherein the target information list records the target information of each identified target.

7. A video recognition device, characterized in that: The device comprises a determination module and a processing module; wherein, The determining module is used to determine a first video frame from the video information list when the remaining capacity of the video information list is less than a preset capacity; wherein the number of best targets included in the first video frame is a first specified value; The determination module is also used to determine the second video frame corresponding to each of the best targets in the video information list according to the target information of each of the best targets contained in the first video frame; wherein the difference between the quality score of each of the best targets in the first video frame and the quality score of each of the best targets in the second video frame is less than a preset threshold. The processing module is used to delete the video information of the first video frame from the video information list and update the video information of the second video frame corresponding to each of the best targets when the video information list includes the second video frame corresponding to each of the best targets, so that the second video frame corresponding to each of the best targets is used as the best video frame.

8. The device according to claim 7, characterized in that The processing module is also used to search for a third video frame from the video information list and delete the video information of the third video frame from the video information list when a preset cleaning condition is met; wherein the number of optimal targets contained in the third video frame is a second specified value.

9. A video recognition device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.