Hi,
I just read this amazing blog on a technique called NMM (Non Maximum Merging ). I want to know how can I apply this for oriented bounding boxes . If anyone can help me it would be amazing.
1 Like
For now, I have found the Python code…
curr_indices = torch.where(category_ids == category_id)[0]
curr_keep_to_merge_list = greedy_nmm(object_predictions_as_tensor[curr_indices], match_metric, match_threshold)
curr_indices_list = curr_indices.tolist()
for curr_keep, curr_merge_list in curr_keep_to_merge_list.items():
keep = curr_indices_list[curr_keep]
merge_list = [curr_indices_list[curr_merge_ind] for curr_merge_ind in curr_merge_list]
keep_to_merge_list[keep] = merge_list
return keep_to_merge_list
def greedy_nmm(
object_predictions_as_tensor: torch.tensor,
match_metric: str = "IOU",
match_threshold: float = 0.5,
):
"""
Apply greedy version of non-maximum merging to avoid detecting too many
overlapping bounding boxes for a given object.
Args:
object_predictions_as_tensor: (tensor) The location preds for the image
along with the class predscores, Shape: [num_boxes,5].