Пример #1
0
def batch_neighbors(queries, supports, q_batches, s_batches, radius):
    """
    Computes neighbors for a batch of queries and supports
    :param queries: (N1, 3) the query points
    :param supports: (N2, 3) the support points
    :param q_batches: (B) the list of lengths of batch elements in queries
    :param s_batches: (B)the list of lengths of batch elements in supports
    :param radius: float32
    :return: neighbors indices
    """

    return cpp_neighbors.batch_query(queries, supports, q_batches, s_batches, radius=radius)
Пример #2
0
def batch_neighbors(queries, supports, q_batches, s_batches, radius):
    """
	调用cpp_wrapper里面的cpp_neighbors
	可以看出queries 和 supports 的batches的个数是一样的
	return 值的意义 详见neighbors。按顺序储存,储存的是对于当前的queries的点,它在自己所属的batches中,半径为r的范围的点索引
	
	如果第一个参数和第二个参数一致,功能就变成了寻找当前batches中,当前点到其他点小于radius的点的索引
	
    Computes neighbors for a batch of queries and supports
    :param queries: (N1, 3) the query points
    :param supports: (N2, 3) the support points
    :param q_batches: (B) the list of lengths of batch elements in queries
    :param s_batches: (B) the list of lengths of batch elements in supports
    :param radius: float32
    :return: neighbors indices
    """
    return cpp_neighbors.batch_query(queries, supports, q_batches, s_batches, radius=radius)
Пример #3
0
def batch_neighbors_kpconv(queries, supports, q_batches, s_batches, radius,
                           max_neighbors):
    """
    Computes neighbors for a batch of queries and supports, apply radius search
    :param queries: (N1, 3) the query points
    :param supports: (N2, 3) the support points
    :param q_batches: (B) the list of lengths of batch elements in queries
    :param s_batches: (B)the list of lengths of batch elements in supports
    :param radius: float32
    :return: neighbors indices
    """

    neighbors = cpp_neighbors.batch_query(queries,
                                          supports,
                                          q_batches,
                                          s_batches,
                                          radius=radius)
    if max_neighbors > 0:
        return torch.from_numpy(neighbors[:, :max_neighbors])
    else:
        return torch.from_numpy(neighbors)
Пример #4
0
def batch_neighbors(queries, supports, q_batches, s_batches, radius):
    return cpp_neighbors.batch_query(queries,
                                     supports,
                                     q_batches,
                                     s_batches,
                                     radius=radius)