Overflow accuracy verification method and device, equipment and storage medium
By acquiring video, drawing detection area bounding boxes, and dividing video segments, and combining the results of manual annotation to verify the overflow detection algorithm, the problem of verifying the accuracy of traffic overflow detection algorithms has been solved, and the reliability of traffic management has been improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- APOLLO INTELLIGENT CONNECTIVITY (BEIJING) TECH CO LTD
- Filing Date
- 2023-06-29
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies are insufficient to effectively verify the accuracy of traffic overflow detection algorithms, leading to an increased risk of traffic paralysis.
By acquiring video, the prediction results and detection area of the overflow detection algorithm, drawing the detection area bounding box, dividing the video into segments, obtaining the manual annotation results, and comparing the manual annotation and prediction results of the video segments, the accuracy of the overflow detection algorithm is determined.
The accuracy of the overflow detection algorithm was verified, which improved the reliability of traffic management and reduced the risk of traffic paralysis.
Smart Images

Figure CN116977832B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of road traffic, specifically to technical fields such as traffic congestion and traffic overflow, and can be applied to scenarios for overflow accuracy verification. In particular, it relates to an overflow accuracy verification method, device, equipment, and storage medium. Background Technology
[0002] As people's living standards improve, there are more and more vehicles on the road, which easily leads to traffic congestion, especially during commuting hours when traffic congestion is becoming increasingly common.
[0003] Among the many manifestations of traffic congestion, traffic overflow is undoubtedly one of the most serious. Traffic overflow refers to the phenomenon where the length of the queue of vehicles waiting to pass on a certain road segment exceeds the length of the road segment within a specific time period, and even extends into the next road segment. Traffic overflow can cause vehicles to lock up at intersections, resulting in severe traffic congestion or even paralysis, posing a significant threat.
[0004] To avoid traffic congestion caused by traffic overflow, real-time images of the road are typically captured by electronic traffic cameras. Traffic overflow is detected in real time using overflow detection algorithms, and warnings are issued when traffic overflow is detected.
[0005] Therefore, it is necessary to verify the accuracy of the overflow detection algorithm. Summary of the Invention
[0006] This disclosure provides an overflow accuracy verification method, apparatus, device, and storage medium, which can determine the accuracy of overflow detection algorithms.
[0007] According to a first aspect of this disclosure, an overflow accuracy verification method is provided, comprising:
[0008] The algorithm obtains a first video, the overflow prediction result of the overflow detection algorithm for the first video, and the detection area of the overflow detection algorithm in the first video; based on the detection area, it draws a detection area bounding box on the first video to obtain a second video; it divides the second video into at least one video segment according to a preset duration; it obtains the manual annotation results of each video segment, which are used to indicate whether the video segment has overflowed or not, and the manual annotation results are obtained by manually annotating the video segment according to preset rules; based on the manual annotation results of each video segment and the overflow prediction result of the first video, it determines the accuracy of the overflow detection algorithm.
[0009] According to a second aspect of this disclosure, an overflow accuracy verification apparatus is provided, the apparatus comprising: an acquisition module and a processing module.
[0010] The acquisition module is used to acquire the first video, the overflow prediction result of the overflow detection algorithm on the first video, and the detection area of the overflow detection algorithm in the first video.
[0011] The processing module is used to draw a detection region bounding box on the first video based on the detection region to obtain the second video; and to divide the second video into at least one video segment according to a preset duration.
[0012] The acquisition module is also used to acquire the manual annotation results of each video segment. The manual annotation results are used to indicate whether the video segment has overflowed or not. The manual annotation results are obtained by manually annotating the video segment according to preset rules.
[0013] The processing module is also used to determine the accuracy of the overflow detection algorithm based on the manual annotation results of each video segment and the overflow prediction results of the first video.
[0014] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0015] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method according to the first aspect.
[0016] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method according to the first aspect.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0018] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0019] Figure 1 A flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure;
[0020] Figure 2 Another flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure;
[0021] Figure 3 Another flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure;
[0022] Figure 4 Another flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure;
[0023] Figure 5 Another flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure;
[0024] Figure 6 A schematic diagram of the composition of the overflow accuracy verification device provided in the embodiments of this disclosure;
[0025] Figure 7 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0026] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0027] It should be understood that in the embodiments of this disclosure, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0028] As people's living standards improve, there are more and more vehicles on the road, which easily leads to traffic congestion, especially during commuting hours when traffic congestion is becoming increasingly common.
[0029] Among the many manifestations of traffic congestion, traffic overflow is undoubtedly one of the most serious. Traffic overflow refers to the phenomenon where the length of the queue of vehicles waiting to pass on a certain road segment exceeds the length of the road segment within a specific time period, and even extends into the next road segment. Traffic overflow can cause vehicles to lock up at intersections, resulting in severe traffic congestion or even paralysis, posing a significant threat.
[0030] To avoid traffic congestion caused by traffic overflow, real-time images of the road are typically captured by electronic traffic cameras. Traffic overflow is detected in real time using overflow detection algorithms, and warnings are issued when traffic overflow is detected.
[0031] Overflow detection algorithms can identify vehicles in a predetermined area of the road using real-time images captured by road cameras and obtain the speed of each vehicle. Based on pre-set conditions (such as the number of vehicles not exceeding a certain limit and the speed range), they can determine whether traffic overflow has occurred.
[0032] Therefore, it is necessary to verify the accuracy of the overflow detection algorithm.
[0033] Against this background, this disclosure provides an overflow accuracy verification method that can determine the accuracy of overflow detection algorithms.
[0034] The execution subject of the overflow accuracy verification method provided in this disclosure can be a computer or server, or other electronic devices with data processing capabilities; alternatively, the execution subject can be a processor (e.g., a central processing unit (CPU)) in the aforementioned electronic device; furthermore, the execution subject can be an application (APP) installed in the aforementioned electronic device that can implement the function of the method; or, the execution subject can be a functional module or unit in the aforementioned electronic device that has the function of the method, etc. No limitation is placed on the execution subject of this method.
[0035] In some embodiments, the server can be a single server, or it can be a server cluster consisting of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. This disclosure does not limit the specific implementation of the server.
[0036] The following description, in conjunction with the accompanying drawings, provides an exemplary illustration of the method for verifying the accuracy of overflow.
[0037] Figure 1 This is a flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure. Figure 1 As shown, the method may include:
[0038] S101. Obtain the first video, the overflow prediction result of the overflow detection algorithm on the first video, and the detection area of the overflow detection algorithm in the first video.
[0039] For example, when an electronic device acquires the first video, it can either actively request the image device to acquire the first video, or the image device can directly push the acquired first video to the electronic device, enabling the electronic device to acquire the first video. An image device refers to a device capable of capturing images, such as a camera or webcam.
[0040] For example, the overflow prediction result of the first video may include whether an overflow occurred or not, and the time when an overflow occurred.
[0041] For example, the detection area of the overflow detection algorithm in the first video is preset, and there are no restrictions on the shape and size of the detection area.
[0042] S102. Based on the detection area, draw the detection area bounding box on the first video to obtain the second video.
[0043] For example, based on the position of the detection region in the first video, a detection region bounding box with the same shape and size as the detection region can be drawn at the corresponding position on the first video, resulting in a first video displaying the detection region bounding box, i.e., a second video.
[0044] S103. Divide the second video into segments according to the preset duration to obtain at least one video segment.
[0045] For example, the preset duration can be any duration, such as 5 seconds, 10 seconds, etc., and there is no limit to the size of the preset duration.
[0046] S104. Obtain the manual annotation results for each video segment.
[0047] Among them, the manual annotation result is used to indicate whether the video segment has overflowed or not. The manual annotation result is obtained by manually annotating the video segment according to preset rules.
[0048] For example, the manual annotation results can be different characters or symbols manually labeled to video segments. For instance, the video segment that overflows can be labeled with the character "1", and the video segment that does not overflow can be labeled with the character "0".
[0049] S105. Based on the manual annotation results of each video segment and the overflow prediction results of the first video, determine the accuracy of the overflow detection algorithm.
[0050] For example, the accuracy of the overflow detection algorithm can be determined by verifying the consistency between the manually labeled results of each video segment and the overflow prediction results of the first video.
[0051] For example, based on the overflow prediction result of the first video, the overflow prediction results for each video segment can be obtained. The sum of the number of video segments where both the manually labeled and overflow prediction results indicate overflow, and the number of video segments where both the manually labeled and overflow prediction results indicate no overflow, is calculated to obtain a first summation result. Then, the ratio of this first summation result to the number of video segments is calculated to obtain a first ratio. This first ratio represents the detection accuracy of the overflow detection algorithm, which can be used to characterize the accuracy of the overflow detection algorithm. The higher the detection accuracy value, the higher the accuracy of the overflow detection algorithm.
[0052] For example, the accuracy of the overflow detection algorithm can be demonstrated to the user through a display device (such as a monitor, projector, AR or VR device, etc.) or an audio output device (such as headphones, speakers, etc.) set on an electronic device.
[0053] This embodiment of the disclosure obtains a first video, the overflow prediction result of the overflow detection algorithm on the first video, and the detection area of the overflow detection algorithm in the first video. A detection area bounding box identical to the detection area of the overflow detection algorithm is drawn on the first video to obtain a second video displaying the detection area of the overflow detection algorithm. The second video is divided according to a preset duration to obtain at least one video segment. The manual annotation results of each video segment are obtained. Based on the manual annotation results of each video segment and the overflow prediction result of the first video, the consistency between the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment can be determined, thereby determining the accuracy of the overflow detection algorithm.
[0054] Figure 2 This is another schematic flowchart illustrating the overflow accuracy verification method provided in this embodiment of the disclosure. Figure 2 As shown, based on the detection area, a detection region bounding box is drawn in the first video to obtain the second video, which may include:
[0055] S201. Create a base map with the same resolution and size as the first video.
[0056] For example, it can be done through image processing tools (such as Adobe Photoshop) TM Affinity Photo TM (etc.) Create a base map with the same resolution and size as the first video and draw other graphics on the base map.
[0057] S202. Draw the detection region bounding box on the base map based on the pixel coordinates of the vertex of the detection region in the first video.
[0058] For example, a point can be randomly selected on the image of the first video as the origin to establish a Cartesian coordinate system, thereby obtaining the pixel coordinates of the vertex of the detection region; correspondingly, the same coordinate system is also established on the base map, and points corresponding to the vertex of the detection region are drawn at the corresponding positions on the base map according to the pixel coordinates of the vertex of the detection region, and then the points are connected in sequence by lines to obtain the detection region bounding box.
[0059] S203. Based on the base map and the first video, the second video is obtained by fusion.
[0060] For example, when fusing the base image with the first video, the fusing operation can be implemented through an image fusion algorithm, or by overlaying the base image with each frame of the first video. Both image fusion algorithms and image overlay techniques are mature existing technologies and will not be elaborated here.
[0061] This embodiment draws a detection region bounding box at the same position as the detection area on a base map with the same resolution size as the first video, and merges the base map and the first video. This allows the detection area of the overflow detection algorithm to be accurately displayed on the first video, resulting in a second video. This enables humans to accurately label the traffic overflow status of video segments, improving the accuracy of verifying the accuracy of the overflow detection algorithm.
[0062] Figure 3 This is another schematic flowchart illustrating the overflow accuracy verification method provided in this disclosure. Figure 3 As shown, the accuracy of the overflow detection algorithm is determined based on the manual annotation results of each video segment and the overflow prediction results of the first video. This can include:
[0063] S301. Based on the overflow prediction results of the first video and each video segment, determine the overflow prediction results corresponding to each video segment.
[0064] For example, the overflow prediction results of the first video at the start and end times corresponding to each video segment can be used as the overflow prediction results for each video segment.
[0065] For example, if the first video is 9 seconds long and the overflow prediction result for the first video is that overflow will occur at the 7th second, and the second video is divided into video segments A, B, and C, with the start and end times of video segment A being 0 to 3 seconds, video segment B being 3 to 6 seconds, and video segment C being 6 to 9 seconds, then the overflow prediction result for video segment A is that no overflow has occurred, the overflow prediction result for video segment B is that no overflow has occurred, and the overflow prediction result for video segment C is that overflow has occurred.
[0066] S302. Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, determine the first quantity and the second quantity respectively.
[0067] The first quantity represents the number of video segments that experienced overflow, as both the manually labeled result and the corresponding overflow prediction result represent the number of video segments that experienced overflow. The second quantity represents the number of video segments that experienced overflow, as both the manually labeled result and the corresponding overflow prediction result represent the number of video segments that experienced overflow.
[0068] S303. Determine the accuracy of the overflow detection algorithm based on the first quantity and the second quantity.
[0069] For example, after obtaining the first quantity and the second quantity, the sum of the first quantity and the second quantity can be calculated first to obtain the first summation result. Then, the ratio of the second quantity to the first summation result can be calculated to obtain the first ratio result. The first ratio result is the false alarm rate of the overflow detection algorithm, which can be used to characterize the accuracy of the overflow detection algorithm. The higher the false alarm rate, the lower the accuracy of the overflow detection algorithm.
[0070] This embodiment determines the overflow prediction result corresponding to each video segment by using the overflow prediction result of the first video and each video segment. Based on the manual annotation result of each video segment and the overflow prediction result corresponding to each video segment, a first quantity and a second quantity can be determined. The first quantity, that is, the number of video segments in which both the manual annotation result and the corresponding overflow prediction result indicate that overflow has occurred, and the second quantity, that is, the number of video segments in which the manual annotation result indicates that overflow has not occurred and the corresponding overflow prediction result indicates that overflow has occurred, can quantify the accuracy of the overflow detection algorithm and accurately determine the accuracy of the overflow detection algorithm.
[0071] Figure 4 This is another schematic flowchart illustrating the overflow accuracy verification method provided in this disclosure. Figure 4 As shown, the accuracy of the overflow detection algorithm is determined based on the manual annotation results of each video segment and the overflow prediction results of the first video. This can include:
[0072] S401. Based on the overflow prediction results of the first video and each video segment, determine the overflow prediction results corresponding to each video segment.
[0073] For example, S401 can be referred to the description of S301 above, and will not be repeated here.
[0074] S402. Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, determine the third and fourth quantities respectively.
[0075] The third quantity represents the number of video segments that experienced overflow, as both the manually labeled result and the corresponding overflow prediction result represent the number of video segments that experienced overflow. The fourth quantity represents the number of video segments that experienced overflow, as both the manually labeled result and the corresponding overflow prediction result represent the number of video segments that did not experience overflow.
[0076] S403. Determine the accuracy of the overflow detection algorithm based on the third and fourth quantities.
[0077] For example, after obtaining the third and fourth quantities, the sum of the third and fourth quantities can be calculated first to obtain a first summation result. Then, the ratio of the fourth quantity to the first summation result can be calculated to obtain a first ratio result. The first ratio result is the false negative rate of the overflow detection algorithm, which can be used to characterize the accuracy of the overflow detection algorithm. The larger the false negative rate, the lower the accuracy of the overflow detection algorithm.
[0078] This embodiment determines the overflow prediction result for each video segment by using the overflow prediction result of the first video and each video segment. Based on the manual annotation result of each video segment and the overflow prediction result corresponding to each video segment, the third quantity and the fourth quantity can be determined. The third quantity, that is, the number of video segments in which both the manual annotation result and the corresponding overflow prediction result indicate that overflow has occurred, and the fourth quantity, that is, the number of video segments in which the manual annotation result indicates that overflow has occurred and the corresponding overflow prediction result indicates that overflow has not occurred, can quantify the accuracy of the overflow detection algorithm and accurately determine the accuracy of the overflow detection algorithm.
[0079] Figure 5 This is another schematic flowchart illustrating the overflow accuracy verification method provided in this disclosure. Figure 5 As shown, the accuracy of the overflow detection algorithm is determined based on the manual annotation results of each video segment and the overflow prediction results of the first video. This can include:
[0080] S501. Based on the overflow prediction results of the first video and each video segment, determine the overflow prediction results corresponding to each video segment.
[0081] For example, S501 can be referred to the description of S301 above, and will not be repeated here.
[0082] S502. Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, draw the first curve and the second curve respectively.
[0083] The first curve represents the manual annotation results for each video segment, while the second curve represents the overflow prediction results for the first video.
[0084] For example, video segments can be sorted by their corresponding real times, with the video segment number as the x-axis and the condition of whether overflow occurred as the y-axis, to establish a planar coordinate system. Based on the manual annotation results for each video segment, the points corresponding to the manual annotation results are plotted on the planar coordinate system and connected sequentially to obtain the first curve; based on the overflow prediction results for each video segment, the points corresponding to the overflow prediction results for each video segment are plotted on the planar coordinate system and connected sequentially to obtain the second curve.
[0085] S503. Determine the accuracy of the overflow detection algorithm based on the first curve and the second curve.
[0086] For example, the accuracy of the overflow detection algorithm can be characterized by calculating the similarity between the first curve and the second curve. The more similar the first curve and the second curve are, the higher the accuracy of the overflow detection algorithm.
[0087] This embodiment determines the overflow prediction result corresponding to each video segment by using the overflow prediction result of the first video and each video segment. Based on the manual annotation result of each video segment and the overflow prediction result corresponding to each video segment, a first curve representing the manual annotation result of each video segment and a second curve representing the overflow prediction result of the first video can be plotted. Based on the first curve and the second curve, the accuracy of the overflow detection algorithm can be quantified, and the accuracy of the overflow detection algorithm can be accurately determined.
[0088] Among some possible implementations, Figure 3 , Figure 4 , Figure 5 The corresponding implementation examples can be combined in any way to implement the aforementioned method.
[0089] In one possible embodiment, the preset rule is that if a number of vehicles greater than or equal to a preset threshold are in the detection area frame within a preset time period, the video segment annotation will overflow.
[0090] This embodiment enables manual annotation of traffic overflow status in video segments by setting preset rules, thereby improving the accuracy of verifying the accuracy of overflow detection algorithms.
[0091] The foregoing primarily describes the solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0092] In an exemplary embodiment, this disclosure also provides an overflow accuracy verification apparatus, which can be used to implement the overflow accuracy verification method as described in the foregoing embodiments.
[0093] Figure 6 This is a schematic diagram illustrating the composition of the overflow accuracy verification device provided in an embodiment of this disclosure. Figure 6As shown, the device may include an acquisition module 601 and a processing module 602.
[0094] The acquisition module 601 is used to acquire the first video, the overflow prediction result of the overflow detection algorithm on the first video, and the detection area of the overflow detection algorithm in the first video.
[0095] The processing module 602 is used to draw a detection region bounding box on the first video according to the detection region to obtain the second video; and to divide the second video into at least one video segment according to a preset duration.
[0096] The acquisition module 601 is also used to acquire the manual annotation results of each video segment. The manual annotation results are used to indicate whether the video segment has overflowed or not. The manual annotation results are obtained by manually annotating the video segment according to preset rules.
[0097] The processing module 602 is also used to determine the accuracy of the overflow detection algorithm based on the manual annotation results of each video segment and the overflow prediction results of the first video.
[0098] In one possible implementation, the processing module 602 is specifically used for:
[0099] Create a base map with the same resolution and size as the first video; draw the detection region bounding box on the base map based on the pixel coordinates of the vertices of the detection region in the first video; fuse the base map and the first video to obtain the second video.
[0100] In one possible implementation, the processing module 602 is specifically used for:
[0101] Based on the overflow prediction results of the first video and each video segment, determine the overflow prediction results corresponding to each video segment; based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, determine the first quantity and the second quantity respectively. The first quantity is the number of video segments where both the manual annotation results and the corresponding overflow prediction results indicate that overflow has occurred, and the second quantity is the number of video segments where the manual annotation results indicate that overflow has not occurred and the corresponding overflow prediction results indicate that overflow has occurred; based on the first quantity and the second quantity, determine the accuracy of the overflow detection algorithm.
[0102] In one possible implementation, the processing module 602 is specifically used for:
[0103] Based on the overflow prediction results of the first video and each video segment, determine the overflow prediction results corresponding to each video segment; based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, determine the third quantity and the fourth quantity respectively. The third quantity is the number of video segments where both the manual annotation result and the corresponding overflow prediction result indicate that overflow has occurred, and the fourth quantity is the number of video segments where the manual annotation result indicates that overflow has occurred and the corresponding overflow prediction result indicates that overflow has not occurred; based on the third quantity and the fourth quantity, determine the accuracy of the overflow detection algorithm.
[0104] In one possible implementation, the processing module 602 is specifically used for:
[0105] Based on the overflow prediction results of the first video and each video segment, determine the overflow prediction results corresponding to each video segment; based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, draw a first curve and a second curve respectively. The first curve is used to represent the manual annotation results of each video segment, and the second curve is used to represent the overflow prediction results of the first video; based on the first curve and the second curve, determine the accuracy of the overflow detection algorithm.
[0106] In one possible implementation, the preset rule is that if a number of vehicles greater than or equal to a preset threshold are in the detection area frame within a preset time period, the video segment annotation will overflow.
[0107] It should be noted that, Figure 6 The module division described herein is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. For example, two or more functions can be integrated into a single processing module. This disclosure does not impose any limitations on this. The integrated modules described above can be implemented in hardware or as software functional modules.
[0108] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0109] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0110] In an exemplary embodiment, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiments. The electronic device may be the computer or server described above.
[0111] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the above embodiments.
[0112] In an exemplary embodiment, the computer program product includes a computer program that, when executed by a processor, implements the method described in the above embodiments.
[0113] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0114] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the electronic device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0115] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of displays, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0116] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the overflow accuracy verification method. For example, in some embodiments, the overflow accuracy verification method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the overflow accuracy verification method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the overflow accuracy verification method by any other suitable means (e.g., by means of firmware).
[0117] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0119] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0120] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0121] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), middleware components (e.g., an application server), or frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0122] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0123] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0124] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for verifying overflow accuracy, the method comprising: Obtain the first video, the overflow prediction result of the overflow detection algorithm on the first video, and the detection area of the overflow detection algorithm in the first video; Based on the detection area, a detection area bounding box is drawn on the first video to obtain the second video; The second video is divided according to a preset duration to obtain at least one video segment; Obtain the manual annotation results for each of the video segments. The manual annotation results are used to indicate whether the video segment has overflowed or not. The manual annotation results are obtained by manually annotating the video segment according to preset rules. The preset rule is that when a number of vehicles greater than or equal to a preset threshold are within the detection area frame within the preset time period, the annotation of the video segment will overflow. Based on the overflow prediction result of the first video and each video segment, determine the overflow prediction result corresponding to each video segment; The video segments are sorted according to their corresponding real times, and a planar coordinate system is established with the video segment number as the x-axis and whether overflow occurred or not as the y-axis. Based on the manual annotation results of each video segment, the points corresponding to the manual annotation results of each video segment are plotted on the planar coordinate system and connected sequentially to obtain a first curve. Based on the overflow prediction results corresponding to each video segment, the points corresponding to the overflow prediction results of each video segment are plotted on the planar coordinate system and connected sequentially to obtain a second curve. The accuracy of the overflow detection algorithm is determined by calculating the similarity between the first curve and the second curve.
2. The method according to claim 1, wherein drawing a detection region bounding box on the first video based on the detection region to obtain the second video comprises: Create a base map with the same resolution and size as the first video; Based on the pixel coordinates of the vertex of the detection region in the first video, draw the detection region bounding box on the base map; The second video is obtained by fusing the base map and the first video.
3. The method according to claim 1 or 2, further comprising: Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, a first quantity and a second quantity are determined respectively. The first quantity is the number of video segments in which both the manual annotation results and the corresponding overflow prediction results indicate that an overflow has occurred. The second quantity is the number of video segments in which the manual annotation results indicate that no overflow has occurred and the corresponding overflow prediction results indicate that an overflow has occurred. The accuracy of the overflow detection algorithm is determined based on the first quantity and the second quantity.
4. The method according to claim 1 or 2, further comprising: Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, a third quantity and a fourth quantity are determined respectively. The third quantity is the number of video segments in which both the manual annotation results and the corresponding overflow prediction results indicate that an overflow has occurred. The fourth quantity is the number of video segments in which the manual annotation results indicate that an overflow has occurred and the corresponding overflow prediction results indicate that an overflow has not occurred. The accuracy of the overflow detection algorithm is determined based on the third and fourth quantities.
5. An overflow accuracy verification device, the device comprising: The acquisition module is used to acquire the first video, the overflow prediction result of the overflow detection algorithm on the first video, and the detection area of the overflow detection algorithm in the first video; The processing module is configured to draw a detection region bounding box on the first video based on the detection region to obtain a second video; and divide the second video into at least one video segment according to a preset duration. The acquisition module is further configured to acquire the manual annotation results of each video segment. The manual annotation results are used to indicate whether the video segment has overflowed or not. The manual annotation results are obtained by manually annotating the video segment according to preset rules. The preset rule is that when a number of vehicles greater than or equal to a preset threshold are within the detection area frame within the preset time period, the annotation of the video segment will overflow. The processing module is further configured to: determine the overflow prediction result corresponding to each video segment based on the overflow prediction result of the first video and each video segment; sort the video segments according to their corresponding real time, establish a planar coordinate system with the video segment number as the abscissa and overflow occurrence or non-overflow occurrence as the ordinate; plot the points corresponding to the manual annotation results of each video segment on the planar coordinate system according to the manual annotation results of each video segment and connect them sequentially to obtain a first curve; plot the points corresponding to the overflow prediction results of each video segment on the planar coordinate system according to the overflow prediction results of each video segment and connect them sequentially to obtain a second curve; and determine the accuracy of the overflow detection algorithm by calculating the similarity between the first curve and the second curve.
6. The apparatus according to claim 5, wherein the processing module is specifically used for: Create a base map with the same resolution and size as the first video; Based on the pixel coordinates of the vertex of the detection region in the first video, draw the detection region bounding box on the base map; The second video is obtained by fusing the base map and the first video.
7. The apparatus according to claim 5 or 6, wherein the processing module is specifically used for: Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, a first quantity and a second quantity are determined respectively. The first quantity is the number of video segments in which both the manual annotation results and the corresponding overflow prediction results indicate that an overflow has occurred. The second quantity is the number of video segments in which the manual annotation results indicate that no overflow has occurred and the corresponding overflow prediction results indicate that an overflow has occurred. The accuracy of the overflow detection algorithm is determined based on the first quantity and the second quantity.
8. The apparatus according to claim 5 or 6, wherein the processing module is specifically used for: Based on the manual annotation results of each video segment and the overflow prediction results corresponding to each video segment, a third quantity and a fourth quantity are determined respectively. The third quantity is the number of video segments in which both the manual annotation results and the corresponding overflow prediction results indicate that an overflow has occurred. The fourth quantity is the number of video segments in which the manual annotation results indicate that an overflow has occurred and the corresponding overflow prediction results indicate that an overflow has not occurred. The accuracy of the overflow detection algorithm is determined based on the third and fourth quantities.
9. An electronic device comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method according to any one of claims 1-4.
10. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to any one of claims 1-4.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4.