Skip to content

Question about the Score Threshold in nms_points #48

@Lihuiyuan2001

Description

@Lihuiyuan2001

Hi, I’m exploring the NMS implementation in nms_points() and noticed that the threshold for keeping points is set to 1.0 . Is this threshold a deliberate choice for both training and inference, ensuring only high-confidence points are retained? Or is it a placeholder (e.g., for demonstration purposes)?

def nms_points(points, scores, radius, return_indices=False):
# if score > 1.0, the point is forced to be kept regardless
sorted_indices = np.argsort(scores)[::-1]
sorted_points = points[sorted_indices, :]
sorted_scores = scores[sorted_indices]
kept = np.ones(sorted_indices.shape[0], dtype=bool)
tree = scipy.spatial.KDTree(sorted_points)
for idx, p in enumerate(sorted_points):
if not kept[idx]:
continue
# neighbor_indices = tree.query_radius(p[np.newaxis, :], r=radius)[0]
neighbor_indices = tree.query_ball_point(p, r=radius)
neighbor_scores = sorted_scores[neighbor_indices]
keep_nbr = np.greater(neighbor_scores, 1.0)
kept[neighbor_indices] = keep_nbr
kept[idx] = True
if return_indices:
return sorted_points[kept], sorted_indices[kept]
else:
return sorted_points[kept]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions