TARGET DETECTION METHOD, DEVICE, ELECTRONIC APPARATUS AND STORAGE MEDIUM
A target detection method, device, an electronic apparatus, and a storage medium are provided, which are related to a field of computer vision technology. The specific implementation includes: determining at least one first image from multiple images, wherein a candidate target is contained in respective first images; acquiring confidence degrees of the candidate target in the respective first images; calculating an appearance probability of the candidate target according to weights and the confidence degrees of the respective first image; and determining the candidate target as a final target, in a case that the appearance probability meets a first preset condition. A candidate target may be comprehensively determined by using a detection result of multiple images, thereby determining a detected final target, and improving the detection accuracy of the final target.
1 . A target detection method, comprising:
determining at least one first image from multiple images, wherein a candidate target is contained in respective first images;
acquiring confidence degrees of the candidate target in the respective first images;
calculating an appearance probability of the candidate target according to weights of the respective first images and the confidence degrees; and
determining the candidate target as a final target, in a case that the appearance probability meets a first preset condition.
2 . The target detection method according to claim 1 , further comprising:
predicting an appearance position of the final target in a last image among the multiple images according to a change of positions of the final target in the respective first images and a time interval between adjacent images, in a case that the final target is not contained in the last image.
3 . The target detection method according to claim 1 , wherein the calculating the appearance probability of the candidate target comprises:
performing respective multiplications on the weights of the respective first images with the confidence degrees of the candidate target in corresponding first images, to obtain first appearance probabilities of the candidate target in the respective first images; and
adding the first appearance probabilities of the candidate target in the respective first images, to obtain the appearance probability of the candidate target.
4 . The target detection method according to claim 1 , wherein determining the candidate target comprises:
determining, for any target in any one of images, the target as a candidate target in a case that a confidence degree of the target meets a second preset condition.
5 . The target detection method according to claim 2 , wherein determining the candidate target comprises:
determining, for any target in any one of images, the target as a candidate target in a case that a confidence degree of the target meets a second preset condition.
6 . The target detection method according to claim 3 , wherein determining the candidate target comprises:
determining, for any target in any one of images, the target as a candidate target in a case that a confidence degree of the target meets a second preset condition.
7 . The target detection method according to claim 4 , wherein determining the target comprises:
acquiring a first detection frame in any one of the images; and
determining that a target contained in the first detection frame is a target which has been detected in another image previous to the any one of the images, in a case that an overlapping degree of the first detection frame and a second detection frame in the another image meets a third preset condition; or determining that the target contained in the first detection frame is a newly detected target in the any one of the images, in a case that an overlapping degree of the first detection frame and the second detection frame in the another image does not meet the third preset condition.
8 . The target detection method according to claim 5 , wherein determining the target comprises:
acquiring a first detection frame in any one of the images; and
determining that a target contained in the first detection frame is a target which has been detected in another image previous to the any one of the images, in a case that an overlapping degree of the first detection frame and a second detection frame in the another image meets a third preset condition; or determining that the target contained in the first detection frame is a newly detected target in the any one of the images, in a case that an overlapping degree of the first detection frame and the second detection frame in the another image does not meet the third preset condition.
9 . The target detection method according to claim 6 , wherein determining the target comprises:
acquiring a first detection frame in any one of the images; and
determining that a target contained in the first detection frame is a target which has been detected in another image previous to the any one of the images, in a case that an overlapping degree of the first detection frame and a second detection frame in the another image meets a third preset condition; or determining that the target contained in the first detection frame is a newly detected target in the any one of the images, in a case that an overlapping degree of the first detection frame and the second detection frame in the another image does not meet the third preset condition.
10 . A target detection device, comprising:
at least one processor; and
a memory communicatively connected to the at least one processor, wherein
the memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor to enable the at least one processor to:
determine at least one first image from multiple images, wherein a candidate target is contained in respective first images;
acquire confidence degrees of the candidate target in the respective first images;
calculate an appearance probability of the candidate target according to weights of the respective first images and the confidence degrees; and
determine the candidate target as a final target, in a case that the appearance probability meets a first preset condition.
11 . The target detection device according to claim 10 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
predict an appearance position of the final target in a last image among the multiple images according to a change of positions of the final target in the respective first images and a time interval between adjacent images, in a case that the final target is not contained in the last image.
12 . The target detection device according to claim 10 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
perform respective multiplications on the weights of the respective first images with the confidence degrees of the candidate target in corresponding first images, to obtain first appearance probabilities of the candidate target in the respective first images; and
add the first appearance probabilities of the candidate target in the respective first images, to obtain the appearance probability of the candidate target.
13 . The target detection device according to claim 10 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
determine, for any target in any one of images, the target as a candidate target in a case that a confidence degree of the target meets a second preset condition.
14 . The target detection device according to claim 11 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
determine, for any target in any one of images, the target as a candidate target in a case that a confidence degree of the target meets a second preset condition.
15 . The target detection device according to claim 12 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
determine, for any target in any one of images, the target as a candidate target in a case that a confidence degree of the target meets a second preset condition.
16 . The target detection device according to claim 13 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
acquire a first detection frame in any one of the images; and
determine that the target contained in the first detection frame is a target which has been detected in another image previous to the any one of the images, in a case that an overlapping degree of the first detection frame and a second detection frame in the another image meets a third preset condition; or determine that the target contained in the first detection frame is a newly detected target in the any one of the images, in a case that an overlapping degree of the first detection frame and the second detection frame in the another image does not meet the third preset condition.
17 . The target detection device according to claim 14 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
acquire a first detection frame in any one of the images; and
determine that the target contained in the first detection frame is a target which has been detected in another image previous to the any one of the images, in a case that an overlapping degree of the first detection frame and a second detection frame in the another image meets a third preset condition; or determine that the target contained in the first detection frame is a newly detected target in the any one of the images, in a case that an overlapping degree of the first detection frame and the second detection frame in the another image does not meet the third preset condition.
18 . The target detection device according to claim 15 , wherein the instructions are executed by the at least one processor to enable the at least one processor to:
acquire a first detection frame in any one of the images; and
determine that the target contained in the first detection frame is a target which has been detected in another image previous to the any one of the images, in a case that an overlapping degree of the first detection frame and a second detection frame in the another image meets a third preset condition; or determine that the target contained in the first detection frame is a newly detected target in the any one of the images, in a case that an overlapping degree of the first detection frame and the second detection frame in the another image does not meet the third preset condition.
19 . A non-transitory computer readable storage medium for storing computer instructions, wherein the computer instructions, when executed by a computer, cause the computer to:
determine at least one first image from multiple images, wherein a candidate target is contained in respective first images;
acquire confidence degrees of the candidate target in the respective first images;
calculate an appearance probability of the candidate target according to weights of the respective first images and the confidence degrees; and
determine the candidate target as a final target, in a case that the appearance probability meets a first preset condition.
20 . The non-transitory computer readable storage medium according to claim 19 , wherein the computer instructions, when executed by a computer, cause the computer to:
predict an appearance position of the final target in a last image among the multiple images according to a change of positions of the final target in the respective first images and a time interval between adjacent images, in a case that the final target is not contained in the last image.