Explain Filtering mask in Yolo_filter_boxes


C​an anyone explain me why we apply tf.boolean_mask to boxes and classes?

Steps I would follow to figure this out

  1. boolean_mask() is a Tensor transformation. Do I understand the operation it performs to transform the input? tf.boolean_mask  |  TensorFlow Core v2.9.1

  2. Besides the input Tensor, another important input argument is the matrix of boolean values True and False. Do I understand how that matrix was created? What is the functional meaning of the mask compared to the threshold value?

  3. If I apply that mask what parts of the input Tensor are retained, and which parts are suppressed? How does the output Tensor relate to the input Tensor and the threshold that created the mask?

Let us know if these breadcrumbs help you find the path to :bulb:

1 Like

thanks for replying .
we have 5 box anchor, each box have Pc,bx,by,bh,bw, and classes probabilities c1,…c80
if we simply calculate box_class_scores and apply threshold to the them we find the high score of each box and find the related anchor box with high score only?

Sorry, but I don’t really follow the new question. The process here is to take the collection of predicted scores, scoop out the maximums, then compare all those to a threshold, and removing the ones that are below the threshold. And since you have three parallel data structures (scores, boxes, and classes), you have to apply the same keep/remove logic to all three. A mask is one way to do it. It’s kind of like multiplying matrices by a vector of 1 and 0, except with boolean_mask the resulting 0-valued elements are dropped altogether from the output object. HTH