Target detection method and device, computer equipment and storage medium
By fusing the detection result information of the multi-frame image to be detected, the problem of high false alarm rate of the target detection method in the prior art is solved, and more accurate target detection results are achieved.
Patent Information
- Application Number
- CN202411332360.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-14
AI Technical Summary
The target detection method in the prior art has a high false alarm rate, which leads to inaccurate target detection results and makes it difficult to accurately detect dangerous situations in crowded scenarios.
By acquiring at least two frames of images to be detected, each frame of image is detected using an object detection model, the detection result information is obtained, and the detection result information of multiple frames of images is fused to determine the object detection result.
It improves the accuracy of target detection and reduces the false alarm rate, so that dangerous situations can be detected more accurately in crowded scenarios.
Smart Images

Figure CN119445299A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a target detection method, device, computer equipment and storage medium. Background Art
[0002] Currently, it is necessary to perform target detection in various scenes to ensure the safety of various scenes. In the prior art, direct detection and identification methods are usually used to directly detect and identify objects in the scene to determine whether there are dangerous situations in the scene that need to be detected and identified. For example, when performing target detection in crowded scenes such as campuses and factories, it is usually necessary to directly detect and identify whether there is a fire in the scene. This direct detection and identification method has a high false alarm rate, resulting in inaccurate target detection results. Therefore, how to perform target detection more accurately is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present invention provide a target detection method, an apparatus, a computer device and a storage medium to solve the problem of how to perform target detection more accurately.
[0004] A target detection method, comprising: Acquire at least two frames of images to be detected; Using the target detection model to detect each of the images to be detected, and determining the detection result information corresponding to each of the images to be detected; The detection result information corresponding to at least two frames of the to-be-detected images is fused to determine the target detection result.
[0005] Preferably, each of the detection result information includes a target category, and an original detection frame position and a confidence level corresponding to each of the target categories; The step of fusing the detection result information corresponding to at least two frames of the images to be detected to determine the target detection result includes: Perform fusion processing based on the original detection frame position and confidence corresponding to the same target category, and determine the fusion processing result corresponding to each target category; Based on the fusion processing results corresponding to each of the target categories, the target detection results corresponding to each of the target categories are determined.
[0006] Preferably, the fusion processing result includes an overlap classification result; The performing fusion processing based on the original detection frame position and confidence corresponding to the same target category to determine the fusion processing result corresponding to each target category includes: Based on the confidences corresponding to the same target category, the original detection frame positions corresponding to the same target category are sorted to determine a list of detection frame positions corresponding to each target category; Classify the detection frame position list corresponding to each target category to determine the overlap classification result corresponding to each target category.
[0007] Preferably, classifying the detection frame position list corresponding to each target category to determine the overlap classification result corresponding to each target category includes: Performing position classification processing on the detection frame position list corresponding to each of the target categories to determine a position classification list for each of the target categories; The position classification list corresponding to each target category is subjected to overlap classification processing to determine the overlap classification result corresponding to each target category.
[0008] Preferably, performing position classification processing on the detection frame position list corresponding to each target category to determine the position classification list corresponding to each target category includes: In the list of detection frame positions corresponding to each target category, the first original detection frame position is determined as the first detection frame position, and the target distance between the other original detection frame positions and the first detection frame position is determined; The first detection frame position and other original detection frame positions whose target distance is less than a preset distance are determined as a first position set corresponding to the first detection frame position, the detection frame position list is updated, and the process of determining the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position is repeated to obtain a position classification list consisting of at least one first position set corresponding to each target category.
[0009] Preferably, performing overlap classification processing on the position classification list corresponding to each target category to determine the overlap classification result corresponding to each target category includes: Obtaining, in the position classification list corresponding to each target category, a target overlap degree between each other original detection frame position in each first position set and the first detection frame position in the same first position set; Determine other original detection frame positions whose target overlap is less than a preset overlap as low-overlap detection frames of the first position set, and determine other original detection frame positions whose target overlap is not less than the preset overlap as high-overlap detection frames of the first position set; Obtaining a first number of the low overlap detection frames and a second number of the high overlap detection frames in each first position set corresponding to each target category; Based on the first number and the second number, an overlap classification result corresponding to each first position set in each target category is determined.
[0010] Preferably, determining the target detection result corresponding to each target category based on the fusion processing result corresponding to each target category includes: If, in the target category, the overlap classification result corresponding to the first position set is that the first quantity is greater than the second quantity, then the first detection frame position in the first position set is determined as the target detection result corresponding to the target category.
[0011] A target detection device, comprising: The image acquisition module to be detected is used to acquire at least two frames of images to be detected; A detection result information determination module, used to detect each of the images to be detected using a target detection model, and determine the detection result information corresponding to each of the images to be detected; The target detection result determination module is used to perform fusion processing on the detection result information corresponding to at least two frames of the images to be detected to determine the target detection result.
[0012] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned target detection method when executing the computer program.
[0013] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the target detection method is implemented.
[0014] The above-mentioned target detection method, device, computer equipment and storage medium use the target detection model to detect at least two frames of images to be detected, obtain the detection result information corresponding to each image to be detected, fuse the detection result information, obtain a more accurate target detection result, and achieve the purpose of more accurate target detection. This method fuses the detection result information of at least two frames of images to be detected, and can perform more comprehensive and accurate detection and analysis on the detection result information of each frame of images to be detected, thereby improving the accuracy of target detection and having high application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0016] Figure 1 is a flow chart of a target detection method in one embodiment of the present invention; Figure 2 is another flow chart of a target detection method according to an embodiment of the present invention; Figure 3 is another flow chart of a target detection method according to an embodiment of the present invention; Figure 4 is another flow chart of a target detection method according to an embodiment of the present invention; Figure 5 is another flow chart of a target detection method according to an embodiment of the present invention; Figure 6 is another flow chart of a target detection method according to an embodiment of the present invention; Figure 7 is a schematic diagram of a target detection device in one embodiment of the present invention; Figure 8 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] The target detection method provided by the embodiment of the present invention can be applied as follows: Figure 8 The computer device shown is used to achieve the purpose of more accurate target detection.
[0019] In one embodiment, if Figure 1 As shown, a target detection method is provided, and the method is applied in Figure 8 The computer device in the example is used as an example to illustrate, including the following steps: S101: Acquire at least two frames of images to be detected; S102: Detect each image to be detected using the target detection model to determine detection result information corresponding to each image to be detected; S103: Fusing the detection result information corresponding to at least two frames of images to be detected to determine the target detection result.
[0020] The image to be detected refers to an image collected in the scene to be detected.
[0021] As an example, in step S101, the computer device acquires at least two frames of images to be detected in the scene to be detected, which are collected for target detection. In this example, the scene to be detected can be imaged at a certain frame rate by a camera device set in the scene to be detected, to obtain at least two frames of images to be detected, and the at least two frames of images to be detected are transmitted to the computer device, and the computer device obtains at least two frames of images to be detected in the scene to be detected. For example, in a scene for detecting a fire, the computer device acquires 32 frames of images to be detected, so as to more accurately perform target detection based on multiple images to be detected. In this example, in order to improve the efficiency of target detection, the computer device can also further extract frames for the acquired images to be detected according to a preset frame extraction rule, to obtain at least two frames of images to be detected, so as to improve the subsequent image to be detected based on the extracted frame, and to more efficiently perform target detection. Among them, the preset frame extraction rule includes but is not limited to extracting frames according to a certain frame rate. For example, in a fire detection scenario, the computer device acquires 32 frames of images to be detected, and performs frame extraction processing on the 32 frames of images to be detected according to the frame extraction rule of extracting frames every two frames, thereby obtaining 16 frames of images to be detected. In this example, extracting frames obtains at least two frames of images to be detected, so that target detection can be performed more efficiently and the target detection result can be determined, which is feasible.
[0022] Among them, the target detection model refers to a model used to detect the image to be detected. It can be understood that the target detection model is used to detect whether there is a target object to be detected in the image to be detected, and is used to detect information such as the location of the target object. Different target objects correspond to different target detection models. The detection result information refers to the information of the target object to be detected in the image to be detected. The target object refers to the object that needs to be detected in the image to be detected. For example, in the scene of fire detection, the target objects include but are not limited to smoke and flames, the target detection model is used to detect smoke and flames, and the detection result information includes but is not limited to information such as the location of the smoke and information such as the location of the flame.
[0023] As an example, in step S102, after acquiring at least two frames of images to be detected of the scene to be detected, the computer device uses a target detection model corresponding to the target object to be detected to detect each frame of the image to be detected, obtains a detection and recognition result, and determines the detection and recognition result as the detection result information. For example, if the scene to be detected is a scene for fire detection, and the target object includes smoke and flames in the scene, the computer device uses a target detection model for detecting smoke and flames to detect each frame of the image to be detected, and determines whether there is smoke and flame in each frame of the image to be detected. If there is smoke and / or flame in the image to be detected, the target detection model is used to output the detection result information such as the position of the smoke and / or flame corresponding to each image to be detected.
[0024] Among them, fusion processing refers to analyzing the detection result information corresponding to multiple images to be detected to determine the processing method of the target detection result. The target detection result refers to the detection result corresponding to the target object in the image to be detected. The detection result includes but is not limited to the relatively accurate position information corresponding to the target object in the image to be detected.
[0025] As an example, in step S103, the computer device inputs the detection result information corresponding to at least two frames of images to be detected into a preset information fusion module, performs fusion processing on the detection result information corresponding to at least two frames of images to be detected, and outputs the target detection result corresponding to the images to be detected. For example, in a scene of fire detection, the computer device inputs the detection result information of each frame of images to be detected corresponding to the flame into the information fusion module, performs fusion analysis on the detection result information corresponding to the flame, so as to screen the detection result information of each frame of images to be detected, and obtain a more accurate target detection result corresponding to the flame, and the target detection result includes the more accurate position information corresponding to the flame in the scene to be detected; the computer device inputs the detection result information of each frame of images to be detected corresponding to the smoke into the information fusion module, performs fusion analysis on the detection result information corresponding to the smoke, so as to screen the detection result information of each frame of images to be detected, and obtain a more accurate target detection result corresponding to the smoke, and the target detection result includes the more accurate position information corresponding to the smoke in the scene to be detected, so as to effectively control the fire of the scene to be detected according to the more accurate position information of the flame and the smoke, and accurately and effectively improve the safety performance of the scene to be detected.
[0026] In this embodiment, a target detection model is used to detect at least two frames of images to be detected, and detection result information corresponding to each image to be detected is obtained. The detection result information is fused to obtain a more accurate target detection result, thereby achieving the purpose of more accurate target detection. This method fuses the detection result information of at least two frames of images to be detected, and can perform more comprehensive and accurate detection and analysis on the detection result information of each frame of images to be detected, thereby improving the accuracy of target detection and having a high application value.
[0027] In one embodiment, each detection result information includes a target category, and an original detection frame position and confidence level corresponding to each target category.
[0028] Among them, the target category refers to the category to which the target object in the image to be detected belongs. Understandably, in the scene of fire detection, there are two target objects that need to be detected, namely smoke and flame. Therefore, in the scene of fire detection, the target object corresponds to the two target categories of smoke and flame. The original detection frame position refers to the position area of the detection frame corresponding to the target object in the image to be detected when the target detection model is used to detect the image to be detected. Confidence refers to the reliability of the target detection model to accurately detect the original detection frame position. The higher the confidence, the more accurate the original detection frame position corresponding to the target object is, and the higher the reliability is.
[0029] In one embodiment, if Figure 2 As shown, step S103, that is, fusing the detection result information corresponding to at least two frames of images to be detected to determine the target detection result, includes: S201: performing fusion processing based on the original detection frame positions and confidences corresponding to the same target category, and determining a fusion processing result corresponding to each target category; S202: Determine the target detection result corresponding to each target category based on the fusion processing result corresponding to each target category.
[0030] The fusion processing result is the processing result generated by fusion processing of the original detection frame position and confidence under the same target category.
[0031] As an example, in step S201, the computer device inputs the original detection frame position and confidence corresponding to the same target category into the information fusion module, performs fusion processing on the original detection frame position and confidence corresponding to the same target category, and determines the fusion processing result corresponding to the original detection frame position of each target category. For example, in a fire detection scenario, when the target category is smoke, the computer device inputs the corresponding original detection frame position and confidence into the information fusion module, performs fusion processing, and obtains the fusion processing result corresponding to each original detection frame position corresponding to smoke; when the target category is flame, the computer device inputs the corresponding original detection frame position and confidence into the information fusion module, performs fusion processing, and obtains the fusion processing result corresponding to each original detection frame position corresponding to flame. In this example, according to different target categories, the original detection frame position and confidence are fused, and the confidence is taken into account, so that the fusion processing result corresponding to each original detection frame position in each target category can be obtained more accurately.
[0032] As an example, in step S202, the computer device identifies the fusion processing result corresponding to each original detection frame position in each target category, and determines the target detection result corresponding to each target category. For example, in a scene of fire detection, the fusion processing result includes positive samples and negative samples. Among them, the positive sample refers to the original detection frame position with higher position accuracy, and the negative sample refers to the original detection frame position with lower position accuracy. The computer device identifies the positive samples and negative samples in the fusion processing result, determines the positive sample corresponding to the target category of smoke, the positive sample corresponding to the target category of flame, and the original detection frame position corresponding to each positive sample, determines the original detection frame position corresponding to the positive sample of the target category of smoke as the target detection result corresponding to smoke, and determines the original detection frame position corresponding to the positive sample of the target category of flame as the target detection result corresponding to flame. In this example, the computer device can select the original detection frame position with higher confidence in the positive sample and determine it as the target detection result corresponding to the target category. It can be understood that the target detection result is used to determine the more accurate position corresponding to the target object of each target category. For example, in a fire detection scenario, target objects with target categories of smoke and flame are detected to determine the more accurate location areas corresponding to the smoke and flame, so as to timely and effectively control the fire based on the more accurate location areas corresponding to the smoke and flame. Therefore, in this example, the original detection frame position with higher position accuracy under the target category is determined as the target detection result corresponding to the target category, which can not only obtain more accurate target detection results, but also improve the safety performance of the scene to be detected based on the more accurate target detection results.
[0033] In this embodiment, the original detection frame position and confidence are fused according to different target categories, and the confidence is taken into account, so that the fusion processing result corresponding to each original detection frame position in each target category can be obtained more accurately. Based on the fusion processing result corresponding to each target category, the target detection result corresponding to each target category can be determined more accurately, thereby improving the safety performance of the scene to be detected.
[0034] In one embodiment, the fusion processing result includes an overlap classification result.
[0035] Among them, the overlap classification result refers to the classification result corresponding to each original detection frame position determined according to the overlap between the original detection frame positions. It can be understood that since the target object in the image to be detected is a changing object, it will produce positional offsets at different times. If the overlap between the original detection frame positions is too high, it means that the position accuracy of the original detection frame position is low. If the overlap between the original detection frame positions is low, it means that the position accuracy of the original detection frame position is high. Therefore, according to the overlap between the original detection frame positions corresponding to each target category, the original detection frame positions corresponding to each target category are classified, so as to more accurately determine the target detection results corresponding to the target category and improve the safety performance of the scene to be detected.
[0036] In one embodiment, if Figure 3 As shown, step S201, i.e., performing fusion processing based on the original detection frame position and confidence corresponding to the same target category, and determining the fusion processing result corresponding to each target category, includes: S301: sorting the original detection frame positions corresponding to the same target category based on the confidence level corresponding to the same target category, and determining a detection frame position list corresponding to each target category; S302: Classify the detection frame position list corresponding to each target category to determine the overlap classification result corresponding to each target category.
[0037] The detection frame position list refers to a list obtained by sorting the original detection frame positions corresponding to each target category.
[0038] As an example, in step S301, the computer device sorts the original detection frame positions corresponding to the same target category according to the confidence corresponding to the same target category, and obtains a detection frame position list corresponding to each target category composed of the sorted original detection frame positions. In this example, the computer device sorts the original detection frame positions corresponding to each target category in descending order of confidence, and determines a detection frame position list corresponding to each target category after the confidence is sorted in descending order. For example, in a scene for fire detection, the computer device sorts the original detection frame positions corresponding to smoke and the original detection frame positions corresponding to flame in descending order of confidence, respectively, to obtain a detection frame position list composed of the original detection frame positions after the confidence is sorted in descending order for smoke, and a detection frame position list composed of the original detection frame positions after the confidence is sorted in descending order for flame.
[0039] As an example, in step S302, the computer device performs classification processing on the list of detection frame positions corresponding to each target category, obtains the classification result corresponding to each target category, and determines the classification result as the overlap classification result corresponding to each target category. For example, in a fire detection scenario, the computer device performs classification processing on the original detection frame positions in the list of detection frame positions corresponding to smoke according to a preset overlap classification standard, obtains the overlap classification result corresponding to the original detection frame positions whose target category is smoke, and performs classification processing on the original detection frame positions in the list of detection frame positions corresponding to flames, obtains the overlap classification result corresponding to the original detection frame positions whose target category is flames.
[0040] In this embodiment, a list of detection frame positions corresponding to each target category is obtained, and the list of detection frame positions corresponding to each target category is classified and processed to more accurately determine the overlap classification result corresponding to each target category, so as to determine the target detection result corresponding to each target category based on the overlap classification result corresponding to each target category.
[0041] In one embodiment, if Figure 4 As shown, step S202, that is, classifying the detection frame position list corresponding to each target category to determine the overlap classification result corresponding to each target category, includes: S401: performing position classification processing on the detection frame position list corresponding to each target category to determine a position classification list for each target category; S402: Perform overlap classification processing on the position classification list corresponding to each target category to determine the overlap classification result corresponding to each target category.
[0042] Among them, the position classification processing refers to classifying the original detection frame positions according to the distance relationship between the original detection frame positions.
[0043] As an example, in step S401, the computer device performs position classification processing on the detection frame position list corresponding to each target category according to the position distance between the original detection frame positions in the detection frame position list corresponding to each target category, and obtains a set of original detection frame positions corresponding to at least one position, and the set of original detection frame positions corresponding to at least one position constitutes a position classification list for each target category. It is understandable that since there are original detection frame positions with a small position distance between the original detection frame positions in the detection frame position list corresponding to each target category, the original detection frame positions with a small position distance can be determined as the same position, and a position classification list corresponding to each target category is obtained, so as to more accurately determine the overlap classification result according to the position classification list. For example, in a scene for fire detection, the detection frame position list corresponding to smoke is subjected to position classification processing according to the position distance between the original detection frame positions in the detection frame position list corresponding to smoke, and i positions are obtained: Position 1: , , position i: ;in, is the ath original detection frame position in position 1 corresponding to the smoke; is the bth original detection frame position in position i corresponding to smoke. The detection frame position list corresponding to flame is processed by position classification to obtain j positions: Position 1: , , position j: ;in, is the cth original detection frame position in position 1 corresponding to the flame; is the dth original detection frame position in the position j corresponding to the flame.
[0044] The overlap classification process refers to classifying the original detection frame positions according to the overlap between the original detection frame positions of the same position in the position classification list of the same target category.
[0045] As an example, in step S402, the computer device classifies the original detection frame positions of the same target category according to the overlap between the original detection frame positions in the same position in the position classification list of the same target category, and obtains the overlap classification result corresponding to each position. For example, in a fire detection scene, the original detection frame positions in each of the i positions corresponding to the smoke are classified according to the overlap corresponding to each position, and the overlap classification result corresponding to the original detection frame position in each position is obtained. For example, for position i corresponding to the smoke: ,according to The overlap between It is divided into the original detection frame position with high overlap and the original detection frame position with low overlap.
[0046] In this embodiment, a position classification list is obtained for each target category, and overlap classification processing is performed on the position classification list corresponding to each target category. This can more accurately determine the overlap classification result corresponding to each target category, so that the subsequent target detection result determined based on the overlap classification result is more accurate.
[0047] In one embodiment, if Figure 5 As shown, step S401, i.e., performing position classification processing on the detection frame position list corresponding to each target category to determine the position classification list corresponding to each target category, includes: S501: Determine the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position, and determine the target distance between the other original detection frame positions and the first detection frame position; S502: Determine the first detection frame position and other original detection frame positions whose target distances are less than a preset distance as a first position set corresponding to the first detection frame position, update the detection frame position list, and repeatedly determine the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position, to obtain a position classification list consisting of at least one first position set corresponding to each target category.
[0048] The first detection frame position refers to the first original detection frame position, and the other original detection frame positions refer to the original detection frame positions other than the first detection frame position.
[0049] As an example, in step S501, the computer device determines the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position, and determines the original detection frame positions other than the first detection frame position in the detection frame position list corresponding to each target category as other original detection frame positions, and determines the target distance between the other original detection frame positions and the first detection frame position in the detection frame position list corresponding to each target category. For example, the computer device may calculate the Euclidean distance between the center point of each other original detection frame position in each detection frame position list and the center point of the first detection frame position, and determine the Euclidean distance as the target distance between each other original detection frame position and the first detection frame position.
[0050] The preset distance refers to a preset distance used to determine the size of the target distance. The first position set refers to a position set consisting of other original detection frame positions whose target distance is less than the preset distance and the first detection frame position.
[0051] As an example, in step S502, the computer device uses the method in step S501 to determine the target distance between each other original detection frame position and the first detection frame position in the detection frame position list corresponding to each target category, and determines the size relationship between each target distance and the preset distance, and arranges the first detection frame position and other original detection frame positions whose target distance is less than the preset distance in the order in the detection frame position list to form a first position set corresponding to the first detection frame position. In the detection frame position list, delete the other original detection frame positions and the first detection frame position whose target distance is less than the preset distance to update the detection frame position list, and repeat steps S501 to S502, that is, repeatedly determine the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position, and determine the first position set in the updated detection frame position list, until there is no original detection frame position in the detection frame position list corresponding to each target category, and obtain a position classification list consisting of at least one first position set corresponding to each target category.
[0052] For example, for a target object of a target category, there is a list of n original detection box positions: If the preset distance is 6, the computer device determines is the first detection frame position, For other original detection frame positions, Zhongyu The other original detection frame positions and the first detection frame position whose target distance is less than the preset distance 6 are determined as the first position set. middle, and and If the target distance is less than the preset distance 6, and Determined as the first position set , and delete it from the list of detection box positions and ,Will Updated to the first detection box position in the detection box position list, the updated detection box position list is , repeat the above steps of determining the first position set until the detection box position list does not include any original detection box position, and finally obtain a position classification list consisting of at least one first position set under the target category.
[0053] In this embodiment, other original detection frame positions and the first detection frame position whose target distance is less than the preset distance are determined as the first position set corresponding to the first detection frame position. This method is used to obtain the first position set in the detection frame position list corresponding to each target category, and a position classification list composed of at least one first position set is obtained. This method classifies the original detection frame position corresponding to each target category more accurately according to the target distance, so as to more accurately determine the overlap classification result corresponding to each target category according to the position classification list.
[0054] In one embodiment, if Figure 6 As shown, step S402, that is, performing overlap classification processing on the position classification list corresponding to each target category to determine the overlap classification result corresponding to each target category, includes: S601: Obtaining, in a position classification list corresponding to each target category, a target overlap degree between each other original detection frame position in each first position set and a first detection frame position in the same first position set; S602: determining other original detection frame positions whose target overlap is less than a preset overlap as low-overlap detection frames of the first position set, and determining other original detection frame positions whose target overlap is not less than the preset overlap as high-overlap detection frames of the first position set; S603: Obtaining a first number of low-overlap detection frames and a second number of high-overlap detection frames in each first position set corresponding to each target category; S604: Determine, based on the first quantity and the second quantity, an overlap classification result corresponding to each first position set in each target category.
[0055] The target overlap refers to the target overlap between other original detection frame positions in the position classification list and the first detection frame position.
[0056] As an example, in step S601, the computer device obtains the overlap between each other original detection frame position in each first position set and the first detection frame position in the same first position set in the position classification list corresponding to each target category, and determines the overlap as the target overlap between each other original detection frame position and the first detection frame position in the same first position set. In this example, the computer device performs an intersection over union (IOU) process between each other original detection frame position in the first position set and the first detection frame position in the same first position set to obtain the target overlap between each other original detection frame position and the first detection frame position. For example, for a first position set , is the first detection frame position, and the computer device respectively Between the first detection frame position Perform intersection and comparison processing to obtain The first detection frame position The target overlap between The first detection frame position The target overlap between The position of the first detection frame The target overlap between .
[0057] The preset overlap refers to the overlap that is preset for determining the size of the target overlap. The low overlap detection frame refers to other original detection frame positions that have a low target overlap with the first detection frame position. The high overlap detection frame refers to other original detection frame positions that have a high target overlap with the first detection frame position.
[0058] As an example, in step S602, the computer device compares the target overlap corresponding to each other original detection frame position in each first position set corresponding to each target category with the preset overlap, and determines the other original detection frame positions with target overlap less than the preset overlap as low overlap detection frames of the first position set, and determines the other original detection frame positions with target overlap not less than the preset overlap as high overlap detection frames of the first position set. The preset overlap can be set to 0.8. For example, for the first position set ,like First detection frame position The target overlap between them is 0.5. First detection frame position The target overlap between them is 0.6. The first detection frame position The target overlap between is 0.9, then and Determine the low overlap detection box of the first position set, and A high overlap detection box of the first position set is determined.
[0059] In this example, based on the relationship between the target overlap and the preset overlap, the low overlap detection frame and the high overlap detection frame of each first position set corresponding to each target category can be determined more accurately, so that more accurate target detection can be performed based on the low overlap detection frame and the high overlap detection frame of each first position set corresponding to each target category.
[0060] The first number refers to the number of low-overlap detection frames in the first position set, and the second number refers to the number of high-overlap detection frames in the first position set.
[0061] As an example, in step S603, the computer device counts the number of low overlap detection frames and the number of high overlap detection frames in each first position set of the position classification list corresponding to each target category, and obtains a first number of low overlap detection frames and a second number of high overlap detection frames in each first position set. ,like First detection frame position The target overlap between them is 0.5. First detection frame position The target overlap between them is 0.6. The first detection frame position If the target overlap between the two is 0.9, the first number of low overlap detection frames in the first position set is 2, and the second number of high overlap detection frames in the first position set is 1.
[0062] As an example, in step S604, the computer device determines the overlap classification result corresponding to each first position set in each target category according to the first number of low overlap detection frames and the second number of high overlap detection frames in each first position set corresponding to each target category. In this example, the overlap classification result includes that in each first position set, the first number of low overlap detection frames is greater than the second number of high overlap detection frames, or the first number of low overlap detection frames is not greater than the second number of high overlap detection frames. When the computer device determines that in a first position set corresponding to a target category, the first number of low overlap detection frames is greater than the second number of high overlap detection frames, the computer device determines that the first number is greater than the second number as the overlap classification result of the first position set corresponding to the target category. When the computer device determines that in a first position set corresponding to a target category, the first number of low overlap detection frames is not greater than the second number of high overlap detection frames, the computer device determines that the first number is not greater than the second number as the overlap classification result of the first position set corresponding to the target category.
[0063] Understandably, since the target object to be detected in the scene to be detected is moving, for example, in the scene of fire detection, the target object includes smoke and flame, both of which move over time. If the first number of low-overlap detection frames between other original detection frame positions and the first detection frame position is large in the same position, it indicates that the low-overlap detection frames in the image to be detected in the position can more accurately reflect the position of the target object. If the second number of high-overlap detection frames between other original detection frame positions and the first detection frame position is large in the same position, it indicates that the image to be detected in the position cannot more accurately reflect the position of the target object. Therefore, when performing target detection, it is necessary to determine the first number of low-overlap detection frames and the second number of high-overlap detection frames between other original detection frame positions and the first detection frame position in each first position set corresponding to the target object of each target category in the collected image to be detected. The more the first number, the more accurate the position information of the target object corresponding to the overlap detection frame is.
[0064] In this embodiment, in the position classification list corresponding to the target category, if the target overlap of other original detection frame positions in the same first position set is less than the preset overlap, it indicates that the overlap between the other original detection frame positions and the first detection frame position is low; if the target overlap of other original detection frame positions in the same first position set is not less than the preset overlap, it indicates that the overlap between the other original detection frame positions and the first detection frame position is high. This method can more accurately determine the low overlap detection frames and the high overlap detection frames in each first position set corresponding to each target category, and then more accurately determine the first number of low overlap detection frames and the second number of high overlap detection frames in each first position set, as well as the overlap classification results corresponding to each first position set corresponding to each target category.
[0065] In one embodiment, step S202, i.e., determining the target detection result based on the overlap classification results corresponding to at least two target categories, includes: if in the target category, the overlap classification results corresponding to the first position set are a first quantity greater than a second quantity, then determining the first detection box position in the first position set as the target detection result corresponding to the target category.
[0066] As an example, when a computer device determines that a first position set has a first quantity greater than a second quantity in a target category, the computer device determines the first position set as a positive sample, and determines the first detection frame position in the positive sample (first position set) as the target detection result corresponding to the target category. When a computer device determines that a first position set has a first quantity not greater than a second quantity in a target category, the computer device determines the first position set as a negative sample, and does not output the target detection result corresponding to the negative sample. The computer device uses the above method to determine all first position sets in each target category whose overlap classification results are the first quantity greater than the second quantity, determine all first position sets whose overlap classification results are the first quantity greater than the second quantity as positive samples, and determine the first detection frame position in all positive samples (first position sets) as the target detection result corresponding to the target category.
[0067] For example, in a fire detection scenario, when the target category is smoke, if a first position set corresponding to the smoke middle, and is a low overlap detection box, For a high overlap detection frame, the overlap classification result is that the first quantity is 2 and the second quantity is 1, that is, when the overlap classification result is that the first quantity is greater than the second quantity, the first position set is determined as a positive sample, and the first detection frame position in the first position set (positive sample) is determined as the target detection result corresponding to the target category; if a first position set corresponding to smoke middle, and is a high overlap detection frame, For a low overlap detection frame, the overlap classification result is that the first quantity is 1 and the second quantity is 2, that is, when the overlap classification result is that the first quantity is not greater than the second quantity, the first position set is determined as a negative sample, and the target detection result corresponding to the first position set (negative sample) is not output.
[0068] For another example, in a fire detection scenario, when the target category is flame, if a first position set corresponding to the flame middle, and is a low overlap detection box, For a high overlap detection frame, the overlap classification result is that the first number is 2 and the second number is 1, that is, when the overlap classification result is that the first number is greater than the second number, the first position set is determined as a positive sample, and the first detection frame position in the first position set (positive sample) is determined as the target detection result corresponding to the target category; if a first position set corresponding to the flame middle, and is a high overlap detection frame, For a low overlap detection frame, the overlap classification result is that the first quantity is 1 and the second quantity is 2, that is, when the overlap classification result is that the first quantity is not greater than the second quantity, the first position set is determined as a negative sample, and the target detection result corresponding to the negative sample is not output.
[0069] The computer device determines and outputs, in each target category, the first detection frame position corresponding to each first position set whose first quantity is greater than the second quantity as the target detection result according to the above method.
[0070] In this embodiment, for the first position set determined according to the target distance being less than the preset distance, the lower the overlap between the original detection frame positions within it, the more accurately the image to be detected in the first position set can reflect the moving position of the target object. Conversely, the higher the overlap between the original detection frame positions within it, the greater the false alarm rate of the image to be detected in the first position set. In addition, in the first position set, the more the first number of low overlap detection frames is, the more accurate the original detection frame positions in the image to be detected in the first position set are. It can be seen from step S502 that when determining the first position set, the confidence corresponding to the first detection frame position is higher. Therefore, when it is determined that the first number of low overlap detection frames is greater than the second number of high overlap detection frames, outputting the first detection frame position in the first position set can more accurately and reliably reflect the target detection result corresponding to the target category to which the first position set belongs.
[0071] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0072] In one embodiment, a target detection device is provided, which corresponds one-to-one to the target detection method in the above embodiment. Figure 7 As shown, the target detection device includes a to-be-detected image acquisition module 701, a detection result information determination module 702, and a target detection result determination module 703. Each functional module is described in detail as follows: The image acquisition module 701 is used to acquire at least two frames of images to be detected; A detection result information determination module 702 is used to detect each of the images to be detected using a target detection model, and determine the detection result information corresponding to each of the images to be detected; The target detection result determination module 703 is used to perform fusion processing on the detection result information corresponding to at least two frames of the to-be-detected images to determine the target detection result.
[0073] In one embodiment, the target detection result determination module 703 includes: The fusion processing result determination submodule performs fusion processing based on the original detection frame position and confidence corresponding to the same target category, and determines the fusion processing result corresponding to each target category; The target detection result determination submodule determines the target detection result corresponding to each target category based on the fusion processing result corresponding to each target category.
[0074] In one embodiment, the fusion processing result determination submodule includes: A detection frame position list determination unit, which sorts the original detection frame positions corresponding to the same target category based on the confidence corresponding to the same target category, and determines a detection frame position list corresponding to each target category; The overlap classification result determination unit is used to classify the detection frame position list corresponding to each target category and determine the overlap classification result corresponding to each target category.
[0075] In one embodiment, the target detection result determination submodule includes: A position classification list determining unit, used to perform position classification processing on the detection frame position list corresponding to each target category, and determine the position classification list for each target category; The overlapping degree classification result determination unit is used to perform overlapping degree classification processing on the position classification list corresponding to each target category, and determine the overlapping degree classification result corresponding to each target category.
[0076] In one embodiment, the location classification list determining unit includes: a target distance determination subunit, configured to determine, in the list of detection frame positions corresponding to each target category, the first original detection frame position as the first detection frame position, and determine target distances between other original detection frame positions and the first detection frame position; The position classification list determination subunit is used to determine the first detection frame position and other original detection frame positions whose target distance is less than a preset distance as a first position set corresponding to the first detection frame position, update the detection frame position list, and repeatedly determine the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position, so as to obtain a position classification list corresponding to each target category consisting of at least one first position set.
[0077] In one embodiment, the overlap classification result determination unit includes: The target overlap determination subunit is used to obtain the target overlap between each other original detection frame position in each first position set and the first detection frame position in the same first position set in the position classification list corresponding to each target category; The overlap detection frame determination subunit is used to determine other original detection frame positions whose target overlap is less than a preset overlap as low overlap detection frames of the first position set, and determine other original detection frame positions whose target overlap is not less than the preset overlap as high overlap detection frames of the first position set; A quantity acquisition subunit, used to acquire a first quantity of low overlap detection frames and a second quantity of high overlap detection frames in each first position set corresponding to each target category; The overlap classification result determination subunit determines, based on the first quantity and the second quantity, an overlap classification result corresponding to each first position set in each target category.
[0078] In one embodiment, the target detection result determination submodule includes: The target detection result determination unit is used to determine the first detection frame position in the first position set as the target detection result corresponding to the target category if the overlap classification result corresponding to the first position set in the target category is that the first quantity is greater than the second quantity.
[0079] For the specific definition of the target detection device, please refer to the definition of the target detection method above, which will not be repeated here. Each module in the above target detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0080] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used or generated during the execution of the target detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a target detection method is implemented.
[0081] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the target detection method in the above embodiment is implemented, for example Figure 1 S101-S103 as shown, or Figures 2 to 6 Alternatively, when the processor executes the computer program, the functions of each module / unit in the target detection device in this embodiment are realized, such as the functions of the to-be-detected image acquisition module 701, the detection result information determination module 702, and the target detection result determination module 703 shown in the target detection device, which are not described here to avoid repetition.
[0082] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the target detection method in the above embodiment is implemented, for example Figure 1 S101-S103 as shown, or Figures 2 to 6 Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above-mentioned target detection device embodiment are realized, for example Figure 7 The functions of each module / unit in the target detection device of this embodiment shown, such as the functions of the to-be-detected image acquisition module 701, the detection result information determination module 702 and the target detection result determination module 703 shown in the target detection device, are not described here to avoid repetition. The computer-readable storage medium may be non-volatile or volatile.
[0083] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0084] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0085] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A target detection method, characterized in that: include: Acquire at least two frames of images to be detected; Using the target detection model to detect each of the images to be detected, and determining the detection result information corresponding to each of the images to be detected; The detection result information corresponding to at least two frames of the to-be-detected images is fused to determine the target detection result.
2. The target detection method according to claim 1, characterized in that: Each of the detection result information includes a target category, and an original detection frame position and a confidence level corresponding to each of the target categories; The step of fusing the detection result information corresponding to at least two frames of the images to be detected to determine the target detection result includes: Perform fusion processing based on the original detection frame position and confidence corresponding to the same target category, and determine the fusion processing result corresponding to each target category; Based on the fusion processing results corresponding to each of the target categories, the target detection results corresponding to each of the target categories are determined.
3. The target detection method according to claim 2, characterized in that: The fusion processing result includes an overlap classification result; The performing fusion processing based on the original detection frame position and confidence corresponding to the same target category to determine the fusion processing result corresponding to each target category includes: Based on the confidences corresponding to the same target category, the original detection frame positions corresponding to the same target category are sorted to determine a list of detection frame positions corresponding to each target category; Classify the detection frame position list corresponding to each target category to determine the overlap classification result corresponding to each target category.
4. The target detection method according to claim 3, characterized in that: Classifying the detection frame position list corresponding to each target category to determine the overlap classification result corresponding to each target category includes: Performing position classification processing on the detection frame position list corresponding to each of the target categories to determine a position classification list for each of the target categories; The position classification list corresponding to each target category is subjected to overlap classification processing to determine the overlap classification result corresponding to each target category.
5. The target detection method according to claim 4, characterized in that: The performing position classification processing on the detection frame position list corresponding to each target category to determine the position classification list corresponding to each target category includes: In the list of detection frame positions corresponding to each target category, the first original detection frame position is determined as the first detection frame position, and the target distance between the other original detection frame positions and the first detection frame position is determined; The first detection frame position and other original detection frame positions whose target distance is less than a preset distance are determined as a first position set corresponding to the first detection frame position, the detection frame position list is updated, and the process of determining the first original detection frame position in the detection frame position list corresponding to each target category as the first detection frame position is repeated to obtain a position classification list consisting of at least one first position set corresponding to each target category.
6. The target detection method according to claim 5, characterized in that: The performing overlap classification processing on the position classification list corresponding to each target category to determine the overlap classification result corresponding to each target category includes: Obtaining, in the position classification list corresponding to each target category, a target overlap degree between each other original detection frame position in each first position set and the first detection frame position in the same first position set; Determine other original detection frame positions whose target overlap is less than a preset overlap as low-overlap detection frames of the first position set, and determine other original detection frame positions whose target overlap is not less than the preset overlap as high-overlap detection frames of the first position set; Obtaining a first number of the low overlap detection frames and a second number of the high overlap detection frames in each first position set corresponding to each target category; Based on the first number and the second number, an overlap classification result corresponding to each first position set in each target category is determined.
7. The target detection method according to claim 6, characterized in that: The determining, based on the fusion processing result corresponding to each target category, the target detection result corresponding to each target category comprises: If, in the target category, the overlap classification result corresponding to the first position set is that the first quantity is greater than the second quantity, then the first detection frame position in the first position set is determined as the target detection result corresponding to the target category.
8. A target detection device, characterized in that: include: The image acquisition module to be detected is used to acquire at least two frames of images to be detected; A detection result information determination module, used to detect each of the images to be detected using a target detection model, and determine the detection result information corresponding to each of the images to be detected; The target detection result determination module is used to perform fusion processing on the detection result information corresponding to at least two frames of the images to be detected to determine the target detection result.
9. A computer 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 computer program, the target detection method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the target detection method according to any one of claims 1 to 7 is implemented.