CN114445622A - Target detection method, device, equipment and processor - Google Patents

Target detection method, device, equipment and processor Download PDF

Info

Publication number
CN114445622A
CN114445622A CN202210044031.1A CN202210044031A CN114445622A CN 114445622 A CN114445622 A CN 114445622A CN 202210044031 A CN202210044031 A CN 202210044031A CN 114445622 A CN114445622 A CN 114445622A
Authority
CN
China
Prior art keywords
position information
target
candidate
arithmetic logic
ratio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210044031.1A
Other languages
Chinese (zh)
Inventor
郑丹丹
王昌宝
李亮
滕海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202210044031.1A priority Critical patent/CN114445622A/en
Publication of CN114445622A publication Critical patent/CN114445622A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the specification discloses a target detection method, a target detection device, target detection equipment and a processor. The scheme can comprise the following steps: when screening is carried out on a plurality of candidate areas containing the target object obtained based on the target detection processing, a plurality of arithmetic logic units in the target processor are utilized to carry out parallel operation to calculate and generate a first target intersection ratio among the plurality of candidate areas, so that the area where the target object is located is determined from the plurality of candidate areas based on the first target intersection ratio among the plurality of candidate areas.

Description

Target detection method, device, equipment and processor
Technical Field
The present application relates to the field of target detection technologies, and in particular, to a target detection method, an apparatus, a device, and a processor.
Background
With the development of computer technology and optical imaging technology, people gradually start to detect a target Object in an image acquired by a device through an Object Detection (Object Detection) technology so as to reduce the consumption of manpower resources. At present, after the image is subjected to the target detection processing, a large number of candidate regions containing the target object are usually obtained, and since there may be a situation of high repetition between the candidate regions, the candidate regions need to be screened to determine the final region where the target object is located, so that the real-time performance of the target detection is directly affected by the time consumed for screening the candidate regions.
Based on this, how to improve the screening efficiency for the candidate region to ensure the real-time performance of target detection becomes a technical problem to be solved urgently.
Disclosure of Invention
The method, the device, the equipment and the processor for target detection provided by the embodiment of the specification can improve the screening efficiency aiming at the candidate area so as to ensure the real-time performance of target detection.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
an object detection method provided by an embodiment of the present specification is applied to an object processor including a first number of arithmetic logic units that can be run in parallel, the arithmetic logic units being configured to calculate an intersection ratio between two regions, and the method includes:
acquiring a plurality of first position information sets; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
sending the first plurality of sets of position information to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number;
receiving a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel;
and determining the area where the target object is located from the candidate areas based on the intersection ratio of the plurality of first targets.
An object detection apparatus provided in an embodiment of the present specification, applied to an object processor including a first number of arithmetic logic units that can be executed in parallel, the arithmetic logic units being configured to calculate an intersection ratio between two regions, includes:
the acquisition module is used for acquiring a plurality of first position information groups; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
a first sending module, configured to send the plurality of first location information sets to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number;
a receiving module, configured to receive a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel;
and the determining module is used for determining the area where the target object is located from the candidate areas based on the plurality of first target intersection ratios.
An object detection device provided in an embodiment of the present specification includes:
at least one processor comprising a first number of arithmetic logic units operable in parallel and storing instructions executable by the processor to enable the processor to:
acquiring a plurality of first position information sets; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
sending the first plurality of sets of position information to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number; the arithmetic logic unit is used for calculating the intersection ratio between the two areas;
receiving a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel;
and determining the area where the target object is located from the candidate areas based on the intersection ratio of the plurality of first targets.
An embodiment of the present specification provides a processor for target detection, where the processor includes: the device comprises an input interface, a control unit and an operation unit comprising a first number of arithmetic logic units capable of running in parallel;
the input interface is used for acquiring a plurality of first position information sets; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
the control unit is used for indicating to send the plurality of first position information groups to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number;
the arithmetic unit is configured to generate a plurality of first target intersection ratios by executing the second number of arithmetic logic units in parallel, and determine an area where the target object is located from the candidate area based on the plurality of first target intersection ratios.
At least one embodiment provided in the present specification can achieve the following advantageous effects:
when a plurality of candidate areas containing the target object obtained based on the target detection processing are screened, a plurality of arithmetic logic units in the target processor are used for performing parallel operation to calculate and generate first target intersection ratios of the plurality of candidate areas, so that the area where the target object is located is determined from the plurality of candidate areas based on the calculated plurality of first target intersection ratios. Because the target processor is provided with a plurality of arithmetic logic units capable of running in parallel, and each arithmetic logic unit can generate the intersection ratio among the candidate areas, the generation efficiency of the intersection ratio among the candidate areas can be improved by utilizing the parallel running of the plurality of arithmetic logic units, and the screening efficiency aiming at the candidate areas can be improved, so that the real-time performance of target detection is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a schematic flow chart of an overall scheme of a target detection method in an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a target detection method provided in an embodiment of the present disclosure;
FIG. 3 is a schematic lane flow chart corresponding to the target detection method in FIG. 2 provided in the embodiments of the present disclosure;
FIG. 4 is a schematic structural diagram of an object detection apparatus corresponding to FIG. 2 provided in an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an object detection apparatus corresponding to fig. 2 provided in an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of one or more embodiments of the present disclosure more apparent, the technical solutions of one or more embodiments of the present disclosure will be described in detail and completely with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from the embodiments given herein without making any creative effort fall within the scope of protection of one or more embodiments of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
In the prior art, with the wide application of Deep Learning (DL), the target detection technology has been rapidly developed. When detecting a target object in an image based on a target detection technology, each region in the image may be processed by using a pre-trained classifier to determine probability (i.e., confidence) that each region in the image contains the target object, and the region with higher confidence is used as a candidate region. Since the overlapping degree (e.g., the intersection ratio) between some candidate regions is relatively large, and the target objects included in the candidate regions with relatively large overlapping degree are usually the same object, the candidate regions need to be filtered and screened to determine the final region where the target object is located.
Currently, Non-Maximum Suppression (NMS) methods can be used to screen candidate regions. Specifically, for all candidate regions of the target object, a candidate region with the highest confidence coefficient may be selected first, the intersection ratio between the candidate region with the highest confidence coefficient and other candidate regions is calculated respectively, the candidate region corresponding to the intersection ratio larger than the preset threshold is filtered out, so as to obtain an updated candidate region to be screened, and the updated candidate region to be screened is continuously screened by using the same principle until the candidate region to be screened does not exist any more.
Currently, although the variety of computer processors is increasing, most of the computer processors usually provide only an acceleration unit for a deep learning algorithm, and these computer processes can reduce the time consumption for determining candidate regions by using the deep learning algorithm in the target detection process, but these computer processors still take longer time for performing intersection than calculation, numerical sorting, numerical comparison, and the like, so that the efficiency of screening candidate regions by using a non-maximum suppression method in the target detection process is low, and the real-time performance of the target detection method is affected.
In order to solve the defects in the prior art, the scheme provides the following embodiments:
fig. 1 is a schematic flow chart of an overall scheme of a target detection method in an embodiment of the present specification.
As shown in fig. 1, when a target object (such as a human face) in an image is detected, position information of a plurality of candidate regions (such as a first candidate region 101, a second candidate region 102, a third candidate region 103, a fourth candidate region 104, and a fifth candidate region 105) including the target object may be obtained.
When the candidate regions are filtered, a plurality of first position information groups may be determined, where each first position information group includes position information of two candidate regions, and the position information included in different first position information groups is different. Sending the plurality of first sets of location information to a second number of the arithmetic logic units in the target processor that are operable in parallel; the second number is greater than 1 and less than or equal to the first number, so that a plurality of arithmetic logic units are utilized to run in parallel to generate a plurality of first target intersection ratios for a plurality of first position information groups. Subsequently, the area where the target object is located may be determined from the candidate areas based on the plurality of first target intersection ratios.
In the target detection scheme in fig. 1, because the target processor has a plurality of arithmetic logic units capable of running in parallel, and each arithmetic logic unit can generate the intersection ratio between the candidate regions, the generation efficiency of the intersection ratio between the candidate regions can be improved by running the plurality of arithmetic logic units in parallel, and the screening efficiency for the candidate regions can be improved, so as to ensure the real-time performance of target detection
Next, a method for detecting an object provided in an embodiment of the specification will be specifically described with reference to the accompanying drawings:
fig. 2 is a schematic flowchart of a target detection method provided in an embodiment of the present disclosure. From the program perspective, the execution subject of the flow may be a target processor containing a first number of arithmetic logic units that can be executed in parallel, or an application program loaded in the target processor; an Arithmetic And Logic Unit (ALU) may refer to a combinational Logic circuit capable of implementing multiple sets of Arithmetic And Logic operations, And the ALU at the target processor may be used to calculate the intersection ratio between two regions. As shown in fig. 2, the process may include the following steps:
step 202: acquiring a plurality of first position information sets; each of the first position information groups includes position information of two candidate regions, and the position information included in different first position information groups is different, and the candidate regions are prediction regions including a target object obtained by performing target detection processing on an image.
In this embodiment, a target detection model based on deep learning may be trained in advance using a sample image including a target object to perform target detection on an image to be detected using the trained target detection model, and the trained target detection model may output position information of a plurality of prediction regions including the target object (i.e., position information of candidate regions).
In this embodiment of the present specification, when screening candidate regions based on a non-maximum suppression method, multiple rounds of iterative screening operations may need to be performed based on the same principle, multiple cross-over ratios among multiple candidate regions may need to be calculated in each round of screening, and each cross-over ratio needs to be generated based on location information of two candidate regions, so that location information of two candidate regions, for which the cross-over ratio needs to be calculated, may be used as a first location information group, so that a first target cross-over ratio may be calculated based on each first location information group in a subsequent process, and then candidate regions may be screened based on the first target cross-over ratio.
In practical applications, if the position information included in the two first position information groups is the same, it may be indicated that the candidate regions to which the position information included in the two first position information groups belongs are the same, so that when the intersection ratio is calculated based on the two first position information groups, the calculation is equivalent to twice for the intersection ratio between the two candidate regions, which results in a waste of computing resources. Based on this, the position information contained in the different first position information sets should be different.
Step 204: sending the first plurality of sets of position information to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number.
In this embodiment, each of the arithmetic logic units in the target processor may be configured to generate a cross-over ratio between two regions, and each of the arithmetic logic units may be run in parallel, so that when a plurality of first target cross-over ratios need to be generated for a plurality of first position information sets, the plurality of first position information sets may be sent to the plurality of arithmetic logic units, so that the plurality of arithmetic logic units may generate the plurality of first target cross-over ratios through parallel running, and the calculation efficiency of the first target cross-over ratios is improved.
In practical applications, since the target processor includes a first number of ALUs, i.e., the number of ALUs at the target processor is limited, the number of ALUs (i.e., the second number) for receiving and processing the plurality of first position information sets should not be greater than the first number.
Step 206: receiving a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel.
In this embodiment, after sending the plurality of first position information sets to the second number of arithmetic logic units, the second number of arithmetic logic units may generate corresponding first target cross-over ratios for the respective first position information sets by operating in parallel, so that the target processor may receive the plurality of first target cross-over ratios.
Step 208: and determining the area of the target object from the candidate areas based on the plurality of first target intersection ratios.
In the embodiment of the present specification, when the candidate regions are screened based on the non-maximum suppression method, the candidate regions with a high partial overlap ratio for the same target object need to be filtered out, so that redundant candidate frames can be removed based on the first target intersection ratio between the candidate regions, so as to determine the region where the target object with better accuracy is located.
In the method in fig. 2, because the target processor has a plurality of arithmetic logic units capable of running in parallel, and each arithmetic logic unit can generate the cross-over ratio between the candidate regions, the generation efficiency of the cross-over ratio between the candidate regions can be improved by running the plurality of arithmetic logic units in parallel, and the efficiency of screening the candidate regions based on the NMS algorithm can be improved to ensure the real-time performance of target detection.
Based on the method in fig. 2, some specific embodiments of the method are also provided in the examples of this specification, which are described below.
In this embodiment, the target processor may be an embedded Neural-Network Processing Unit (NPU). The NPU processor is designed for Artificial Intelligence (AI) calculation, and accelerates AI (such as deep learning and neural network) calculation by adopting a data-driven parallel calculation architecture, and solves the problem of low efficiency of the traditional chip during AI calculation, thereby being particularly good at processing massive multimedia data such as videos and images.
In embodiments of the present description, the NPU processor may be utilized to execute an NMS algorithm to screen candidate regions. Because the NMS algorithm needs to calculate the cross-over ratio among a plurality of candidate areas, a plurality of arithmetic logic units which can run in parallel and can calculate the cross-over ratio can be set for the NPU processor, so that the efficiency of the NPU processor for executing the NMS algorithm is improved based on the plurality of arithmetic logic units, the screening efficiency of the candidate areas can be improved, and the real-time performance of target detection is ensured.
In practical application, a hardware device can be used for constructing the arithmetic logic unit based on the cross-over ratio calculation principle so as to ensure the calculation performance of the arithmetic logic unit for the cross-over ratio. For example, it is assumed that the position information of the first candidate region may be (x1, y1, w1, h1), where x1, y1, w1, and h1 are respectively an abscissa of an upper left corner of the first candidate region, an ordinate of an upper left corner, a side length of the first candidate region in the horizontal axis direction, and a side length of the first candidate region in the vertical axis direction. Similarly, the position information of the second candidate region may be (x2, y2, w2, h 2). Then when calculating the intersection ratio between the first candidate region and the second candidate region, the following formula may be referred to:
Figure BDA0003471449270000071
area3=w3×h3;
w3=min(x2+w2,x1+w1)-max(x1,x2);
h3=min(y2+h2,y1+h1)-max(y1,y2);
area1=w1×h1;
area2=w2×h2;
the IOU is an intersection ratio between the first candidate region and the second candidate region, area1 is an area of the first candidate region, area2 is an area of the second candidate region, area3 is an area of an overlapping region between the first candidate region and the second candidate region, w3 is a side length of the overlapping region in a horizontal axis direction, h3 is a side length of the overlapping region in a vertical axis direction, min () is a minimum function for determining a minimum value of the two values, and max () is a maximum function for determining a maximum value of the two values.
By analyzing the calculation logic of the formula for calculating the intersection ratio, the calculation hardware unit for calculating the intersection ratio can be completed by utilizing the multiplication operation unit and the addition operation unit to be used as the arithmetic logic unit ALU at the target processor, so that the arithmetic logic unit at the target processor can be ensured to have higher calculation capability for the intersection ratio. Of course, the arithmetic logic unit ALU may be constructed by a division unit, a subtraction unit, a comparator, and the like, in addition to the multiplication and addition unit, and this is not particularly limited.
In this embodiment of the present description, after performing target detection on an image, the target detection model may output position information of a plurality of candidate regions and a probability (i.e., a confidence) that a target object is included in each candidate region. Since the NMS method needs to determine the location information of the candidate region for which the intersection ratio needs to be calculated based on the confidence of the candidate region, step 202: acquiring a plurality of first position information sets may specifically include:
position information of a third number of the candidate regions is obtained.
And obtaining the confidence degree which represents that each candidate region contains the target object.
Generating a fourth number of first position information groups according to the confidence degrees and the position information of the candidate regions of the third number; the fourth number is the difference between the third number and 1; each first position information group contains position information of the candidate region with the maximum confidence coefficient, and the other piece of position information contained in different first position information groups is different.
In this embodiment of the present specification, when a plurality of candidate regions are iteratively screened based on an NMS algorithm, for each iteration process, a candidate region with the maximum confidence level needs to be determined from candidate regions to be screened, and an intersection ratio between other candidate regions to be screened and the candidate region with the maximum confidence level is respectively calculated, so as to filter a part of the candidate regions based on the intersection ratio.
Based on this, assuming that the candidate regions to be screened in the current iteration process are the candidate regions of the third number, an intersection ratio of the fourth number (i.e., a difference between the third number and 1) needs to be calculated, so that first position information sets of the fourth number need to be generated, and each first position information set should include position information of a candidate region with the highest degree of confidence in the candidate regions of the third number, and candidate regions corresponding to another piece of position information included in different first position information sets should be different, so that different first position information sets are used for calculating the intersection ratio between the candidate region with the highest degree of confidence and different other candidate regions.
In practical applications, when the first round of iterative screening operation for the candidate regions in the NMS method is performed, the acquired location information of the third number of candidate regions should be all candidate regions detected from the image by the target detection model. And when the nth (N is greater than 1) iteration screening operation for the candidate regions in the NMS method is executed, the acquired location information of the third number of candidate regions is the updated candidate region to be screened obtained after the execution of the nth-1 iteration screening operation is completed.
For ease of understanding, the process of generating the fourth number of first position information sets will be exemplified in conjunction with the contents of fig. 1.
For example, it is assumed that the target detection model belongs to a multi-target detection model, and the target detection model determines position information of 5 candidate regions, such as the first candidate region 101, the second candidate region 102, the third candidate region 103, the fourth candidate region 104, and the fifth candidate region 105, from the image, and the confidence degrees of the 5 candidate regions are: 0.98, 0.81, 0.67, 0.83, 0.75.
When the first round of iterative screening operation for the candidate regions in the NMS method is performed, it is necessary to acquire the position information and the confidence degrees of the above 5 candidate regions and generate 4 first position information sets. Since the confidence of the first candidate region 101 is the greatest, the 4 first position information groups each include the position information of the first candidate region 101; since the other position information included in the 4 first position information groups is different, the other position information included in each of the first position information groups may be the position information of the second candidate region 102, the position information of the third candidate region 103, the position information of the fourth candidate region 104, and the position information of the fifth candidate region 105, respectively. That is, the generated 4 first position information groups may be expressed as: (position information of the first candidate region 101, position information of the second candidate region 102), (position information of the first candidate region 101, position information of the third candidate region 103), (position information of the first candidate region 101, position information of the fourth candidate region 104), (position information of the first candidate region 101, and position information of the fifth candidate region 105).
If the second candidate region 102 and the third candidate region 103 are removed by the first iteration, the updated candidate regions to be filtered are the fourth candidate region 104 and the fifth candidate region 105, so that when the second iteration filtering operation is performed, only the position information of the fourth candidate region 104 and the position information of the fifth candidate region 105 need to be acquired, and 1 first position information set (the position information of the fourth candidate region 104 and the position information of the fifth candidate region 105) is generated.
In the embodiment of the present specification, since the first position information set needs to include the position information of the candidate region with the highest degree of confidence among the third number of candidate regions, when the first position information set is generated, the position information of each candidate region needs to be sorted according to the degree of confidence, so as to generate the first position information set based on the sorting result.
Based on this, the generating a fourth number of first location information sets according to the confidence degrees and the location information of the third number of candidate regions may specifically include:
and sequencing the position information of the candidate regions of the third quantity according to the sequence of the confidence degrees from high to low to obtain a sequencing result.
And generating a fourth number of first position information groups based on the sorting result and the position information of the candidate regions of the third number.
In the embodiment of the present specification, when the terminal is used for target detection, a processor mounted at the terminal generally belongs to a low-power chip, and the processing capability of the processor for sorting operation is weak, so that time consumption for generating the first position information group is long, and the real-time performance of target detection is affected. Thus, the target processor may be utilized for the sequencing operation. Specifically, since the sorting operation may be implemented by a plurality of comparison operations that may be processed in parallel, the position information of the third number of candidate regions may be sorted according to the descending order of the confidence degrees by using a plurality of arithmetic logic units that may be operated in parallel and are provided in the target processor, so as to reduce the time consumed by generating the sorting result, thereby improving the execution efficiency of the NMS method and ensuring the real-time performance of target detection.
In practical applications, in addition to setting the arithmetic logic unit ALU at the target processor based on the calculation logic of the cross-over ratio, the arithmetic logic unit ALU at the target processor may be set based on the execution logic of the sorting operation to ensure that the arithmetic logic unit at the target processor has higher execution capacity for the sorting operation.
In practical application, the position information of each candidate region may be sorted in the order of the confidence degrees from large to small (or from small to large) only when the first round of iterative screening operation for the candidate region in the NMS method is performed, and the subsequent iterative screening operation may be performed based on the sorting result generated in the first round of iteration, so that the time consumption and the calculation amount when the candidate region is screened based on the NMS method may be reduced.
In the embodiment of the present specification, since the number of arithmetic logic units included at the target processor is limited, but the number of first position information sets to be processed is continuously changing, different numbers of first position information sets may need to be sent to different numbers of arithmetic logic units for processing.
Based on this, the sending the plurality of first position information groups to the second number of arithmetic logic units may specifically include:
dividing the fourth number of first position information groups into a fifth number of information sets to be processed, wherein the fifth number is a positive integer obtained by rounding the quotient carry of the fourth number and the first number; each set of information to be processed comprises the first position information sets with the number not larger than the first number, and each first position information set belongs to only one set of information to be processed.
Sending the first position information group to a sixth number of the arithmetic logic units in the information sets to be processed aiming at each information set to be processed; the sixth number is the number of the first position information sets included in the information set to be processed.
In the embodiment of the present specification, it may be indicated that the arithmetic logic unit at the target processor is capable of completing the processing for all the first position information sets within one clock cycle to obtain the fourth number of first target cross-over ratios, provided that the number of the first position information sets (i.e., the fourth number) is equal to or less than the number of the arithmetic logic units at the target processor (i.e., the first number).
If the number of the first location information sets (i.e. the fourth number) is greater than the number of the arithmetic logic units at the target processor (i.e. the first number), it may indicate that the arithmetic logic unit at the target processor cannot complete the processing on all the first location information sets in one clock cycle, at this time, in order to improve the intersection-to-parallel ratio generation efficiency, the first location information sets may be batch-processed by using as many arithmetic logic units at the target processor as possible, wherein each batch of the first location information sets to be processed may be used as one information set to be processed, so that the processing on all the first location information sets is completed in as short time as possible.
For the sake of understanding, the process of dividing and sending the information sets to be processed is illustrated in conjunction with fig. 1 and the above embodiments.
For example, assuming that the target processor includes 3 (i.e., a first number) of arithmetic logic units that can be used in parallel, and when a first round of iterative filtering operation for candidate regions in the NMS method is performed, 4 (i.e., a fourth number) of first position information sets are generated, since a positive integer obtained by rounding a quotient carry of the fourth number and the first number is 2, 2 sets of information to be processed need to be generated.
At this time, any 3 first position information groups among the 4 first position information groups may be divided into a first set of information to be processed, and the remaining 1 first position information groups among the 4 first position information groups may be divided into a second set of information to be processed. In the first clock cycle, 3 first position information groups in the first information set to be processed can be respectively sent to 3 arithmetic logic units, so that the 3 arithmetic logic units run in parallel, and 3 first target cross-over ratios are generated in one clock cycle. In the second clock cycle, 1 first position information group in the second information set to be processed can be sent to 1 arithmetic logic unit, so that the arithmetic logic unit can generate 1 first target cross-over ratio in one clock cycle.
Alternatively, any 2 first position information groups of the 4 first position information groups may be divided into a first information set to be processed, and the remaining 2 first position information groups of the 4 first position information groups may be divided into a second information set to be processed. In the first clock cycle, 2 first position information groups in the first information set to be processed can be respectively sent to 2 arithmetic logic units, so that the 2 arithmetic logic units run in parallel, and thus 2 first target cross-over ratios are generated in one clock cycle. In the second clock cycle, the 2 first position information sets in the second information set to be processed can be sent to the 2 arithmetic logic units, and the 2 arithmetic logic units continue to run in parallel, so that 2 first target cross-over ratios are generated in one clock cycle.
In the embodiment of the present description, the multiple arithmetic logic units running in parallel may complete the cross-over comparison calculation for all the first position information sets in two clock cycles, and compared with four clock cycles required for serially calculating the cross-over ratios corresponding to all the first position information sets, time consumed by the target processor when executing the NMS method may be greatly reduced, so that the efficiency of screening the candidate regions based on the NMS algorithm may be improved, and the real-time performance of target detection may be ensured.
In the embodiment of the present description, when the candidate region is screened based on the NMS method, the candidate region corresponding to the first target intersection ratio larger than the preset threshold needs to be filtered, and the screened candidate region is continuously screened by using the same principle until there is no candidate region to be screened.
Thus, step 208: determining the area where the target object is located from the candidate areas based on the multiple first target intersection ratios, which may specifically include:
determining a second target intersection ratio from the plurality of first target intersection ratios according to a preset threshold value; and the second target intersection ratio is less than or equal to the preset threshold.
Determining the region of the target object from the candidate region set corresponding to the second target intersection; the candidate region set includes the candidate region to which the position information used for generating the second target intersection ratio belongs.
And determining the candidate region with the maximum confidence coefficient in the corresponding candidate region set as the region of the target object by merging the second target.
In this embodiment of the present description, because the first target intersection ratio is used to indicate an overlapping degree between the candidate region with the highest confidence coefficient in the current iteration process and the other candidate regions, if the first target intersection ratio is greater than a preset threshold, it may be indicated that the other candidate regions are the same as the target object included in the candidate region with the highest confidence coefficient in the current iteration process, so that the other candidate regions may be filtered out, and the candidate region with the highest confidence coefficient in the current iteration process may be determined as the region where the target object is located.
If the intersection ratio of the first target is less than or equal to the preset threshold, it may indicate that the other candidate regions are different from the target object included in the candidate region with the highest confidence in the current iteration process, and therefore, the other candidate regions may be temporarily reserved as candidate regions to be filtered, so as to continue to be filtered and filtered in the next iteration process.
For the sake of understanding, the process of determining the region of the target object from the candidate regions will be described by way of example with reference to fig. 1.
For example, assume that the confidences of the first candidate region 101, the second candidate region 102, the third candidate region 103, the fourth candidate region 104, and the fifth candidate region 105 are: 0.98, 0.81, 0.67, 0.83, 0.75. When a first round of iterative screening operation for candidate regions in the NMS method is performed, for 4 first position information groups of (position information of the first candidate region 101, position information of the second candidate region 102), (position information of the first candidate region 101, position information of the third candidate region 103), (position information of the first candidate region 101, position information of the fourth candidate region 104), (position information of the first candidate region 101, and position information of the fifth candidate region 105), the determined 4 first targets are cross-over and are respectively: 0.8, 0.7, 0, if the preset threshold is 0.6, the second target cross-matching corresponding candidate region set may include the first candidate region 101, the fourth candidate region 104, and the fifth candidate region 105. At this time, the first candidate region 101 may be determined as the region where the target object is located, the second candidate region 102 and the third candidate region 103 may be filtered, and the fourth candidate region 104 and the fifth candidate region 105 may be used as candidate regions to be filtered in the next iteration filtering.
In this embodiment of the present specification, the technical principle adopted when determining the region where the target object is located from the second target cross-comparison corresponding candidate region set (i.e., the (N + 1) th iteration screening operation) may be the same as the technical principle adopted when determining the region where the target object is located from the third number of candidate regions (i.e., the (N) th iteration screening operation).
Therefore, the determining the region of the target object from the candidate region set corresponding to the second target cross-matching may specifically include:
generating a plurality of second position information groups according to other candidate regions except the candidate region with the maximum confidence degree in the candidate region set; each second location information group contains location information of two other candidate areas, and the location information contained in different second location information groups is different; the confidence of the candidate region may represent the probability that the candidate region contains the target object.
Sending the plurality of second position information sets to a seventh number of the arithmetic logic units; the seventh number is less than or equal to the first number.
Receiving a third target intersection ratio generated by the arithmetic logic units of the seventh number by running in parallel.
And determining the area where the target object is located from the other candidate areas based on the third target intersection ratio.
In the embodiment of the present specification, when the NMS method is executed, after a plurality of rounds of iterative screening operations, only one second location information set may be generated, and at this time, only the second location information set needs to be sent to an arithmetic logic unit; if the intersection ratio of the third target generated by the arithmetic logic unit is greater than the preset threshold, the candidate region with the maximum confidence degree in the second position information group can be used as the region where the target object is located; if the third target intersection ratio generated by the arithmetic logic unit is less than or equal to the preset threshold, the two candidate regions to which the two pieces of position information in the second position information group belong can be both taken as the regions where the target objects are located, and the target objects contained in the two candidate regions should be different objects.
For the sake of understanding, the process of determining the area of the target object when only one second position information set can be generated will be exemplified in conjunction with the contents of fig. 1 and the contents of the foregoing embodiments.
For example, when the candidate regions to be filtered are the fourth candidate region 104 and the fifth candidate region 105, only one second position information set can be generated, that is, (the position information of the fourth candidate region 104, the position information of the fifth candidate region 105), if the intersection ratio of the third targets generated based on the second position information set is 0.85, since the intersection ratio of the third targets is greater than the preset threshold value 0.6, and the confidence (0.83) of the fourth candidate region 104 is greater than the confidence (0.75) of the fifth candidate region 105, the fifth candidate region 105 needs to be filtered, and the fourth candidate region 104 is determined as the region where the target object is located.
In combination with the above-mentioned embodiment contents, it can be seen that, for the embodiment in fig. 1, when the candidate regions are screened by the NMS method, two iterative screening operations are performed, in the first iterative screening operation, the first candidate region 101 is determined to be the region where a certain target object is located, and in the second iterative screening operation, the fourth candidate region 104 is determined to be the region where another target object is located, so that the multi-target detection for the image is achieved. In practical application, the method in fig. 2 is also applicable to a single-target detection scenario, and details thereof are not repeated.
In the embodiment of the present specification, after generating a plurality of first target cross-comparisons for a plurality of first position information sets, it is generally necessary to store the plurality of first target cross-comparisons, so as to perform screening on candidate regions based on the first target cross-comparisons.
Step 206: after receiving the second number of the first target intersection ratios generated by the arithmetic logic unit running in parallel, the method may further include:
for each first target intersection ratio, storing the first target intersection ratio to the ith row and the ith column in a target matrix; the first target intersection ratio is used for representing the contact ratio between the ith candidate region and the jth prediction region in a candidate region queue, and the candidate region queue is obtained by sequencing the candidate regions according to the sequence of the confidence degrees from high to low. Wherein, the contact ratio is the probability of the target object contained in the candidate area.
Correspondingly, step 208: the determining, according to a preset threshold, a second target intersection ratio from the plurality of first target intersection ratios may specifically include:
and judging whether the first target merging ratio is greater than a preset threshold value or not according to each first target merging ratio to obtain a judgment result.
If the judgment result shows that the first target cross-over ratio is larger than the preset threshold value, setting the first target cross-over ratio in the target matrix to be zero, otherwise, setting the first target cross-over ratio in the target matrix to be a non-zero value;
determining a non-zero value in the target matrix as a second target cross-over ratio.
For ease of understanding, the process of storing a first object intersection ratio to an object matrix and determining a second object intersection ratio based on the object matrix is illustrated in conjunction with the description of FIG. 1 and the description of the embodiments provided above.
For example, when the NMS method is used to screen candidate regions, after a first target intersection ratio generated in the first iteration process is stored in a target matrix, the target matrix may be represented as (0.80.700), since a preset threshold is 0.6, after the target matrix is processed, the target matrix may be obtained as (0011), and at this time, a non-zero value in the target matrix may be determined as a second target intersection ratio.
After the first target cross-over ratio (i.e. the third target cross-over ratio) generated by the second iteration process is stored in the target matrix, the target matrix can be represented as
Figure BDA0003471449270000141
Since the preset threshold is 0.6, after the target matrix is processed, the target matrix can be obtained as
Figure BDA0003471449270000142
Since the second row elements in the target matrix corresponding to the second round of iterative process are all zero, there is no second target cross-over ratio any more, and it can be determined that the iterative screening process in the NMS method is finished.
In the embodiment of the present specification, when the second target merging ratio is determined based on the matrix, it is beneficial to improve the determination efficiency for the second target merging ratio, and further, the screening efficiency of the candidate area can be improved, so as to ensure the real-time performance of target detection.
In the embodiment of the present specification, when the NMS method is executed, the candidate regions may be screened not only based on an Intersection-over-Union (IOU) between the candidate regions, but also based on a Distance-Intersection-IOU (Distance-IOU), a weighted Intersection-over-Union (weighted-IOU), Complete-IoU, generalized-IOU, or the like. Thus, the arithmetic logic unit may also be used to calculate distance cross-over ratios, weighted cross-over ratios, Complete-IoU, generalized-IOU, etc., between two regions.
Since the type of cross-over ratio generated by the running ALU may be determined by the control command received by the ALU, step 206: before receiving the second number of the first target intersection ratios generated by the arithmetic logic unit running in parallel, the method may further include:
sending a control instruction to the second number of the arithmetic logic units using a control unit in a target processor; the control instructions are for instructing the second number of the arithmetic logic units to generate a specified type cross-over ratio based on the first set of location information; the specified type cross-over ratio is the cross-over ratio, the distance cross-over ratio or the weighted cross-over ratio.
Correspondingly, step 206 may specifically include:
the arithmetic logic unit receiving the second number executes the generated plurality of first target cross-over ratios in parallel in response to the control instruction, the first target cross-over ratios belonging to the specified type of cross-over ratio.
In this embodiment of the present specification, the arithmetic logic unit of the target processor may be configured to generate multiple types of intersection ratios, so that the arithmetic logic unit may be controlled by the control instruction to generate a required type of intersection ratio, so as to improve the execution flexibility of the NMS method, which is beneficial to improving the execution flexibility of the target detection method.
FIG. 3 is a schematic lane flow chart corresponding to the target detection method in FIG. 2, provided in an embodiment of the present disclosure. As shown in FIG. 3, the target detection process may involve an input interface, a control unit, and an arithmetic unit comprising a first number of arithmetic logic units operable in parallel in a target processor. The target detection process comprises multiple rounds of operations of iteratively screening candidate regions.
In the nth iteration screening stage, an input interface may acquire a plurality of first position information sets, each of the first position information sets includes position information of two candidate regions, and the position information included in different first position information sets is different, where the candidate regions are prediction regions including target objects obtained by performing target detection processing on images.
The control unit may control the input interface to send the plurality of first position information sets to the second number of arithmetic logic units, and send a control instruction to the second number of arithmetic logic units, the control instruction instructing the second number of arithmetic logic units to generate the specified type cross-over ratio based on the first position information sets.
The arithmetic unit may generate a plurality of first target intersection ratios by running a second number of arithmetic logic units in parallel, the first target intersection ratios belonging to the specified type of intersection ratio. The operation unit can also determine a second target intersection ratio from a plurality of first target intersection ratios according to a preset threshold value, wherein the second target intersection ratio is less than or equal to the preset threshold value; the second target is cross-compared with the candidate region with the maximum confidence coefficient in the corresponding candidate region set, and the candidate region is determined as the region where the target object is located; and taking other candidate regions except the candidate region with the maximum confidence coefficient in the candidate region set as candidate regions to be screened in the (N + 1) th iteration screening.
In the (N + 1) th round of iterative screening, the input interface may obtain a plurality of second position information sets generated based on the candidate regions to be screened, which are determined in the previous round of iterative screening.
The control unit may control sending the plurality of second position information groups to the seventh number of arithmetic logic units, and sending a control instruction to the seventh number of arithmetic logic units, the control instruction instructing the seventh number of arithmetic logic units to generate the specified type cross-over ratio based on the second position information groups.
The arithmetic unit may generate a third target intersection ratio by executing a seventh number of arithmetic logic units, the third target intersection ratio belonging to the specified type of intersection ratio. The operation unit can also determine a fourth target intersection ratio from third target intersection ratios according to a preset threshold value, wherein the fourth target intersection ratio is less than or equal to the preset threshold value; determining the candidate region with the highest confidence coefficient in the fourth target intersection set compared with the corresponding candidate region set as the region of the target object; and taking other candidate regions except the candidate region with the maximum confidence coefficient in the candidate region set as candidate regions to be screened in the (N + 2) th iteration screening.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method. Fig. 4 is a schematic structural diagram of an object detection apparatus corresponding to fig. 2 provided in an embodiment of the present disclosure, where the object detection apparatus may be applied to an object processor including a first number of arithmetic logic units that can be run in parallel, and the arithmetic logic units may be used to calculate an intersection ratio between two regions. As shown in fig. 4, the apparatus may include:
an obtaining module 402, configured to obtain a plurality of first position information sets; each of the first position information groups includes position information of two candidate regions, and the position information included in different first position information groups is different, and the candidate regions are prediction regions including a target object obtained by performing target detection processing on an image.
A first sending module 404, configured to send the plurality of first position information sets to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number.
A receiving module 406, configured to receive a plurality of first target cross-over ratios generated by the second number of the arithmetic logic units through parallel operations.
A determining module 408, configured to determine, based on the multiple first target intersection ratios, a region where the target object is located from the candidate regions.
The examples of this specification also provide some specific embodiments of the apparatus based on the apparatus of fig. 4, which is described below.
Optionally, the apparatus shown in fig. 4, the obtaining module 402, may include:
a first obtaining unit configured to obtain position information of a third number of the candidate regions.
And the second acquisition unit is used for acquiring the confidence degree which represents that the target object is contained in each candidate area.
A generating unit, configured to generate a fourth number of first position information groups according to the confidence degrees and the position information of the third number of candidate regions; the fourth number is the difference between the third number and 1; each first position information group contains position information of the candidate region with the maximum confidence coefficient, and the other piece of position information contained in different first position information groups is different.
Optionally, the generating unit may be specifically configured to:
and sequencing the position information of the candidate regions of the third quantity according to the sequence of the confidence degrees from high to low to obtain a sequencing result.
And generating a fourth number of first position information groups based on the sorting result and the position information of the candidate regions of the third number.
Optionally, the first sending module 404 may be specifically configured to:
dividing the fourth number of first position information groups into a fifth number of information sets to be processed, wherein the fifth number is a positive integer obtained by rounding the quotient carry of the fourth number and the first number; each set of information to be processed comprises the first position information sets with the number not larger than the first number, and each first position information set belongs to only one set of information to be processed.
Sending the first position information group to a sixth number of the arithmetic logic units in the information sets to be processed aiming at each information set to be processed; the sixth number is the number of the first position information groups included in the information set to be processed.
Optionally, the determining module 408 may include:
the first determining unit is used for determining a second target intersection ratio from the plurality of first target intersection ratios according to a preset threshold; and the second target intersection ratio is less than or equal to the preset threshold.
A second determining unit, configured to determine, from the candidate region set corresponding to the second target cross-matching, a region where the target object is located; the candidate region set includes the candidate region to which the position information used for generating the second target intersection ratio belongs.
Optionally, the candidate region has a confidence indicating that the target object is contained within the candidate region; the second determining unit may be specifically configured to:
generating a plurality of second position information groups according to other candidate regions except the candidate region with the maximum confidence degree in the candidate region set; each of the second location information groups includes location information of two of the other candidate areas, and the location information included in the different second location information groups is different.
Sending the plurality of second position information sets to a seventh number of the arithmetic logic units; the seventh number is less than or equal to the first number.
Receiving a third target intersection ratio generated by the arithmetic logic units of the seventh number by running in parallel.
And determining the area where the target object is located from the other candidate areas based on the third target intersection ratio.
Optionally, the second determining unit may be further configured to:
and determining the candidate region with the maximum confidence coefficient in the candidate region set as the region of the target object.
Optionally, the candidate region has a confidence indicating that the target object is contained in the candidate region, and the apparatus in fig. 4 may further include:
the storage module is used for storing the first target cross-over ratio to the ith row and the ith column in the target matrix aiming at each first target cross-over ratio; the first target intersection ratio is used for representing the contact ratio between the ith candidate region and the jth prediction region in a candidate region queue, and the candidate region queue is obtained by sequencing the candidate regions according to the sequence of the confidence degrees from high to low.
The first determining unit may be specifically configured to:
and judging whether the first target merging ratio is greater than a preset threshold value or not according to each first target merging ratio to obtain a judgment result.
If the judgment result shows that the first target cross-over ratio is larger than the preset threshold value, setting the first target cross-over ratio in the target matrix to be zero, otherwise, setting the first target cross-over ratio in the target matrix to be a non-zero value;
determining a non-zero value in the target matrix as a second target cross-over ratio.
Optionally, the arithmetic logic unit is further configured to calculate a distance cross-over ratio and a weighted cross-over ratio between the two regions; the apparatus in fig. 4, may further include:
a second sending module, configured to send a control instruction to the second number of the arithmetic logic units; the control instructions are for instructing the second number of the arithmetic logic units to generate a specified type cross-over ratio based on the first set of location information; the specified type cross-over ratio is the cross-over ratio, the distance cross-over ratio or the weighted cross-over ratio.
The receiving module 406 may specifically be configured to:
the arithmetic logic unit receiving the second number executes the generated plurality of first target cross-over ratios in parallel in response to the control instruction, the first target cross-over ratios belonging to the specified type of cross-over ratio.
Alternatively, in the apparatus in fig. 4, the target processor may be an embedded neural network processor.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method.
Fig. 5 is a schematic structural diagram of an object detection apparatus corresponding to fig. 2 provided in an embodiment of the present disclosure. As shown in fig. 5, the apparatus 500 may include:
at least one processor 510, the processor 510 may include a first number of arithmetic logic units 520 executable in parallel, and the processor stores instructions 530 executable by the processor 510, the instructions 530 being executable by the processor 510 to enable the processor 510 to:
acquiring a plurality of first position information sets; each of the first position information groups includes position information of two candidate regions, and the position information included in different first position information groups is different, and the candidate regions are prediction regions including a target object obtained by performing target detection processing on an image.
Sending the first plurality of sets of position information to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number; the arithmetic logic unit is used for calculating the intersection ratio between the two areas.
The arithmetic logic unit receiving the second number generates a plurality of first target intersection ratios by operating in parallel.
And determining the area where the target object is located from the candidate areas based on the intersection ratio of the plurality of first targets.
Based on the same idea, an embodiment of the present specification further provides a processor for target detection corresponding to the foregoing method, where the processor may include: an input interface, a control unit and an arithmetic unit comprising a first number of arithmetic logic units that can be run in parallel.
The input interface can be used for acquiring a plurality of first position information sets; each of the first position information groups includes position information of two candidate regions, and the position information included in different first position information groups is different, and the candidate regions are prediction regions including a target object obtained by performing target detection processing on an image.
The control unit may be configured to instruct to send the plurality of first position information sets to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number.
The arithmetic unit may be configured to generate a plurality of first target intersection ratios by executing the second number of arithmetic logic units in parallel, and determine the region where the target object is located from the candidate region based on the plurality of first target intersection ratios.
The embodiments in the present specification are all described in a progressive manner, and the same and similar parts in the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus shown in fig. 5, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to part of the description of the method embodiment.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology has evolved, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is an integrated circuit whose Logic functions are determined by a user programming the Device. A digital character system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following micro-controllers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only optical disk read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (22)

1. A target detection method applied to a target processor including a first number of arithmetic logic units operable in parallel, the arithmetic logic units being operable to calculate an intersection ratio between two regions, comprising:
acquiring a plurality of first position information sets; each first position information group comprises position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
sending the first plurality of sets of position information to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number;
receiving a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel;
and determining the area where the target object is located from the candidate areas based on the intersection ratio of the plurality of first targets.
2. The method of claim 1, wherein the obtaining a plurality of first location information sets specifically comprises:
acquiring position information of a third number of the candidate regions;
obtaining confidence degrees which represent that each candidate region contains the target object;
generating a fourth number of first position information groups according to the confidence degrees and the position information of the candidate regions of the third number; the fourth number is the difference between the third number and 1; each first position information group contains position information of the candidate region with the maximum confidence coefficient, and the other piece of position information contained in different first position information groups is different.
3. The method according to claim 2, wherein generating a fourth number of first position information groups according to the confidence degrees and the third number of position information of the candidate regions specifically comprises:
sorting the position information of the candidate regions of the third quantity according to the sequence of the confidence degrees from high to low to obtain a sorting result;
generating a fourth number of first position information groups based on the ranking result and the position information of the third number of the candidate regions.
4. The method of claim 2, wherein sending the plurality of first location information sets to a second number of the ALUs comprises:
dividing the fourth number of first position information groups into a fifth number of information sets to be processed, wherein the fifth number is a positive integer obtained by rounding the quotient carry of the fourth number and the first number; each set of information to be processed comprises the first position information groups with the number not more than the first number, and each first position information group only belongs to one set of information to be processed;
sending the first position information group to a sixth number of the arithmetic logic units in the information set to be processed aiming at each information set to be processed; the sixth number is the number of the first position information sets included in the information set to be processed.
5. The method according to claim 1, wherein the determining, from the candidate regions, the region where the target object is located based on the plurality of first target intersection ratios specifically includes:
determining a second target intersection ratio from the plurality of first target intersection ratios according to a preset threshold value; the second target intersection ratio is less than or equal to the preset threshold;
determining the region of the target object from the candidate region set corresponding to the second target intersection; the candidate region set includes the candidate region to which the position information used for generating the second target intersection ratio belongs.
6. The method of claim 5, the candidate region having a confidence level indicating that the target object is contained within the candidate region;
determining the region where the target object is located from the candidate region set corresponding to the second target cross-correlation, specifically including:
generating a plurality of second position information groups according to other candidate regions except the candidate region with the maximum confidence degree in the candidate region set; each second position information group contains position information of two other candidate areas, and the position information contained in different second position information groups is different;
sending the plurality of second position information sets to a seventh number of the arithmetic logic units; the seventh number is less than or equal to the first number;
receiving a third target intersection ratio generated by the arithmetic logic units of the seventh number by running in parallel;
and determining the area where the target object is located from the other candidate areas based on the third target intersection ratio.
7. The method of claim 6, wherein the determining the region of the target object from the set of candidate regions corresponding to the second target cross-comparison further comprises:
and determining the candidate region with the maximum confidence coefficient in the candidate region set as the region of the target object.
8. The method of claim 5, the candidate region having a confidence level indicating that the target object is contained within the candidate region;
after the receiving the second number of the first target intersection ratios generated by the arithmetic logic unit operating in parallel, the method further comprises:
for each first target intersection ratio, storing the first target intersection ratio to the ith row and the ith column in a target matrix; the first target intersection ratio is used for representing the contact ratio between the ith candidate region and the jth prediction region in a candidate region queue, and the candidate region queue is obtained by sequencing each candidate region according to the sequence of the confidence degrees from high to low;
determining a second target intersection ratio from the plurality of first target intersection ratios according to a preset threshold, specifically comprising:
judging whether the first target cross-over ratio is larger than a preset threshold value or not according to each first target cross-over ratio to obtain a judgment result;
if the judgment result shows that the first target cross-over ratio is larger than the preset threshold value, setting the first target cross-over ratio in the target matrix to be zero, otherwise, setting the first target cross-over ratio in the target matrix to be a non-zero value;
determining a non-zero value in the target matrix as a second target cross-over ratio.
9. The method of claim 1, the arithmetic logic unit further configured to calculate a distance cross-over ratio and a weighted cross-over ratio between two regions;
before the receiving of the second number of the plurality of first target intersection ratios generated by the arithmetic logic unit running in parallel, further comprises:
sending a control instruction to the second number of the arithmetic logic units; the control instructions are used for instructing the arithmetic logic units of the second quantity to generate specified type intersection ratios based on the first position information groups; the specified type cross-over ratio is the cross-over ratio, the distance cross-over ratio or the weighted cross-over ratio;
the receiving of the second number of the plurality of first target intersection ratios generated by the arithmetic logic units through parallel operation specifically includes:
the arithmetic logic unit receiving the second number executes the generated plurality of first target cross-over ratios in parallel in response to the control instruction, the first target cross-over ratios belonging to the specified type of cross-over ratio.
10. The method of any one of claims 1-9, the target processor being an embedded neural network processor.
11. An object detection apparatus for use in an object processor including a first number of arithmetic logic units operable in parallel, the arithmetic logic units being operable to calculate an intersection ratio between two regions, comprising:
the acquisition module is used for acquiring a plurality of first position information groups; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
a first sending module, configured to send the plurality of first location information sets to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number;
a receiving module, configured to receive a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel;
and the determining module is used for determining the area where the target object is located from the candidate areas based on the intersection ratio of the plurality of first targets.
12. The apparatus of claim 11, the acquisition module comprising:
a first acquisition unit configured to acquire position information of a third number of the candidate regions;
a second obtaining unit configured to obtain a confidence that each of the candidate regions includes the target object;
a generating unit, configured to generate a fourth number of first position information groups according to the confidence degrees and the position information of the third number of candidate regions; the fourth number is the difference between the third number and 1; each first position information group contains position information of the candidate region with the maximum confidence coefficient, and the other piece of position information contained in different first position information groups is different.
13. The apparatus according to claim 12, wherein the generating unit is specifically configured to:
sorting the position information of the candidate regions of the third quantity according to the sequence of the confidence degrees from high to low to obtain a sorting result;
generating a fourth number of first position information groups based on the ranking result and the position information of the third number of the candidate regions.
14. The apparatus of claim 12, wherein the first sending module is specifically configured to:
dividing the fourth number of first position information groups into a fifth number of information sets to be processed, wherein the fifth number is a positive integer obtained by rounding the quotient carry of the fourth number and the first number; each set of information to be processed comprises the first position information groups with the number not more than the first number, and each first position information group only belongs to one set of information to be processed;
sending the first position information group to a sixth number of the arithmetic logic units in the information set to be processed aiming at each information set to be processed; the sixth number is the number of the first position information sets included in the information set to be processed.
15. The apparatus of claim 11, the determining module comprising:
the first determining unit is used for determining a second target intersection ratio from the plurality of first target intersection ratios according to a preset threshold; the second target intersection ratio is less than or equal to the preset threshold;
a second determining unit, configured to determine, from the candidate region set corresponding to the second target cross-matching, a region where the target object is located; the candidate region set includes the candidate region to which the position information used for generating the second target intersection ratio belongs.
16. The apparatus of claim 15, the candidate region having a confidence level indicating that the target object is contained within the candidate region;
the second determining unit is specifically configured to:
generating a plurality of second position information groups according to other candidate regions except the candidate region with the maximum confidence degree in the candidate region set; each second position information group contains position information of two other candidate areas, and the position information contained in different second position information groups is different;
sending the plurality of second position information sets to a seventh number of the arithmetic logic units; the seventh number is less than or equal to the first number;
receiving a third target intersection ratio generated by the arithmetic logic units of the seventh number by running in parallel;
and determining the area where the target object is located from the other candidate areas based on the third target intersection ratio.
17. The apparatus of claim 16, the second determining unit further to:
and determining the candidate region with the maximum confidence coefficient in the candidate region set as the region of the target object.
18. The apparatus of claim 15, the candidate region having a confidence level indicating that the target object is contained within the candidate region, the apparatus further comprising:
the storage module is used for storing the first target intersection ratio to the ith row and the ith column in the target matrix aiming at each first target intersection ratio; the first target intersection ratio is used for representing the contact ratio between the ith candidate region and the jth prediction region in a candidate region queue, and the candidate region queue is obtained by sequencing each candidate region according to the sequence of the confidence degrees from high to low;
the first determining unit is specifically configured to:
judging whether the first target cross-over ratio is larger than a preset threshold value or not according to each first target cross-over ratio to obtain a judgment result;
if the judgment result shows that the first target cross-over ratio is larger than the preset threshold value, setting the first target cross-over ratio in the target matrix to be zero, otherwise, setting the first target cross-over ratio in the target matrix to be a non-zero value;
determining a non-zero value in the target matrix as a second target cross-over ratio.
19. The apparatus of claim 11, the arithmetic logic unit further to calculate a distance cross-over ratio and a weighted cross-over ratio between two regions; the device, still include:
a second sending module, configured to send a control instruction to the second number of the arithmetic logic units; the control instructions are for instructing the second number of the arithmetic logic units to generate a specified type cross-over ratio based on the first set of location information; the specified type cross-over ratio is the cross-over ratio, the distance cross-over ratio or the weighted cross-over ratio;
the receiving module is specifically configured to:
the arithmetic logic unit receiving the second number executes the generated plurality of first target cross-over ratios in parallel in response to the control instruction, the first target cross-over ratios belonging to the specified type of cross-over ratio.
20. The apparatus of any one of claims 11-19, the target processor being an embedded neural network processor.
21. An object detection device comprising:
at least one processor comprising a first number of arithmetic logic units operable in parallel and storing instructions executable by the processor to enable the processor to:
acquiring a plurality of first position information groups; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
sending the plurality of first position information sets to a second number of the ALUs; the second number is greater than 1 and less than or equal to the first number; the arithmetic logic unit is used for calculating the intersection ratio between the two areas;
receiving a plurality of first target cross-over ratios generated by the arithmetic logic units of the second number by running in parallel;
and determining the area where the target object is located from the candidate areas based on the intersection ratio of the plurality of first targets.
22. A processor for object detection, the processor comprising: the device comprises an input interface, a control unit and an operation unit comprising a first number of arithmetic logic units capable of running in parallel;
the input interface is used for acquiring a plurality of first position information sets; each first position information group contains position information of two candidate regions, the position information contained in different first position information groups is different, and the candidate regions are prediction regions containing target objects obtained by performing target detection processing on images;
the control unit is used for indicating to send the plurality of first position information groups to a second number of the arithmetic logic units; the second number is greater than 1 and less than or equal to the first number;
the arithmetic unit is used for generating a plurality of first target intersection ratios by parallelly operating the second number of arithmetic logic units, and determining the area where the target object is located from the candidate area based on the plurality of first target intersection ratios.
CN202210044031.1A 2022-01-14 2022-01-14 Target detection method, device, equipment and processor Pending CN114445622A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210044031.1A CN114445622A (en) 2022-01-14 2022-01-14 Target detection method, device, equipment and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210044031.1A CN114445622A (en) 2022-01-14 2022-01-14 Target detection method, device, equipment and processor

Publications (1)

Publication Number Publication Date
CN114445622A true CN114445622A (en) 2022-05-06

Family

ID=81367132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210044031.1A Pending CN114445622A (en) 2022-01-14 2022-01-14 Target detection method, device, equipment and processor

Country Status (1)

Country Link
CN (1) CN114445622A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866484A (en) * 2019-11-11 2020-03-06 珠海全志科技股份有限公司 Driver face detection method, computer device and computer readable storage medium
CN112348828A (en) * 2020-10-27 2021-02-09 浙江大华技术股份有限公司 Example segmentation method and device based on neural network and storage medium
WO2021254205A1 (en) * 2020-06-17 2021-12-23 苏宁易购集团股份有限公司 Target detection method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866484A (en) * 2019-11-11 2020-03-06 珠海全志科技股份有限公司 Driver face detection method, computer device and computer readable storage medium
WO2021254205A1 (en) * 2020-06-17 2021-12-23 苏宁易购集团股份有限公司 Target detection method and apparatus
CN112348828A (en) * 2020-10-27 2021-02-09 浙江大华技术股份有限公司 Example segmentation method and device based on neural network and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
唐小佩;杨小冈;刘云峰;李维鹏;: "遥感图像飞机目标候选区域选取方法研究", 计算机仿真, no. 11, 15 November 2018 (2018-11-15) *
无用: "《一、faster-rcnn源码阅读:nms的CUDA编程》", pages 1 - 9, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/80902998> *
曲終人不散丶: "《一文打尽目标检测NMS——效率提升篇》", pages 1 - 12, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/157900024?utm_id=0> *

Similar Documents

Publication Publication Date Title
Gao et al. Ssap: Single-shot instance segmentation with affinity pyramid
He et al. Enhanced boundary learning for glass-like object segmentation
CN108320296B (en) Method, device and equipment for detecting and tracking target object in video
CN109492674B (en) Generation method and device of SSD (solid State disk) framework for target detection
CN110084299B (en) Target detection method and device based on multi-head fusion attention
CN111311634A (en) Face image detection method, device and equipment
US11861467B2 (en) Adaptive quantization for execution of machine learning models
CN115981870B (en) Data processing method and device, storage medium and electronic equipment
CN111742333A (en) Method and apparatus for performing deep neural network learning
CN111368865B (en) Remote sensing image oil storage tank detection method and device, readable storage medium and equipment
CN111914949B (en) Zero sample learning model training method and device based on reinforcement learning
CN116402113B (en) Task execution method and device, storage medium and electronic equipment
CN114445622A (en) Target detection method, device, equipment and processor
Kharinov et al. Object detection in color image
CN112949642B (en) Character generation method and device, storage medium and electronic equipment
CN115204395A (en) Data processing method, device and equipment
CN112825118B (en) Rotation invariance face detection method, device, readable storage medium and equipment
CN109800873B (en) Image processing method and device
Jokela Person counter using real-time object detection and a small neural network
CN112906728A (en) Feature comparison method, device and equipment
CN111539520A (en) Method and device for enhancing robustness of deep learning model
CN112115952B (en) Image classification method, device and medium based on full convolution neural network
CN113204664B (en) Image clustering method and device
Vu et al. Automatic improvement of graph based image segmentation
Wang et al. Real-Time Texture Extraction Based on the Improved Median Robust Extended Local Binary Pattern

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination