Open RichardSieg opened 6 years ago
It seems like, the 0 comes from the get_score
function from the BoundBox
class:
def get_score(self):
if self.score == -1:
self.score = self.classes[self.get_label()]
return self.score
Why is the class returned in this case? What is the difference between c
and score
? The parameter score
is never set to a given value in BoundBox
:
def __init__(self, xmin, ymin, xmax, ymax, c = None, classes = None):
self.xmin = xmin
self.ymin = ymin
self.xmax = xmax
self.ymax = ymax
self.c = c
self.classes = classes
self.label = -1
self.score = -1
c
is the objectness score. Used to tell whether the bounding box contains anything, if the score is below the object threshold, ignore the box itself.
score
is used to tell what is the probability it is this class. This will always be the highest class probability.
The names could definitely be better imo.
The reason why there are so many boxes being predicted, is because there are 3 prediction layers (The FPN implementation at 3 scales). The number of box predictions are 3 * N * N * 3
or N * N * 3
(I'm not sure on this part atm which is the correct one but I'll explain both)
3 * N * N * 3
= 3 for the scales, N N for the scale size, 3 for the anchors
`N N 3` = N N for the scale size, 3 for the scales
So because of the number of predictions being done, I'm not surprised that that there are plenty of 0 class probability (objectness
/c
)
Ah thanks for the clarification. That makes total sense. I always forget about the multiple output layers. But it would be a nice enhancement, if boxes with score 0 would not be predicted at all @experiencor (if you have time for that of course ;) ) currently I'm throwing them away in my postprocessing step. I will leave this issue open for now, so @experiencor can see it.
I noticed, that generally way more boxes are predicted than in the version before. But nearly all of them have confidence (
score
) 0, although this should be filtered out indecode_netout
:if(objectness <= obj_thresh): continue
. I looked through the code and couldn't find the reason.