Skip to content

With augmentations, remove bbox if less than 25% of the box is visible ? #1580

Answered by glenn-jocher
ExtReMLapin asked this question in Q&A
Discussion options

You must be logged in to vote

@ExtReMLapin anything < 10% of original area should already be removed by the augmentation box candidates function area_thr=0.1 argument.

def box_candidates(self, box1, box2, wh_thr=2, ar_thr=100, area_thr=0.1, eps=1e-16): # box1(4,n), box2(4,n)
# Compute box candidates: box1 before augment, box2 after augment, wh_thr (pixels), aspect_ratio_thr, area_ratio
w1, h1 = box1[2] - box1[0], box1[3] - box1[1]
w2, h2 = box2[2] - box2[0], box2[3] - box2[1]
ar = np.maximum(w2 / (h2 + eps), h2 / (w2 + eps)) # aspect ratio
return (w2 > wh_thr) & (h2 > wh_thr) & (w2 * h2 / (w1 * h1 + eps) > are…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ExtReMLapin
Comment options

@glenn-jocher
Comment options

@ExtReMLapin
Comment options

@glenn-jocher
Comment options

Answer selected by ExtReMLapin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants