Serial order neighbor search module using spatial encoding.
Project description
serial-neighbor
A lightweight and fast implementation of spatial neighbor search using serialization encoding from space filling curves (e.g., Z-order, Hilbert curves).
Designed for 3D point cloud applications, fully compatible with PyTorch.
🚀 Installation
pip install serial-neighbor
🧠 Function Description
serial_neighbor(...)
Finds k nearest neighbors for each query point using serial encoding. We propose to retrieve a neighborhood from a 1-D ordered list, by serializing points along a space-filling curve, and excluding the impact of points distant from the query (i.e. remove false positives).
Arguments:
-
points(Tensor):
Tensor of shape (M, 3) giving the source point cloud with M points in 3D space. -
query_xyz(Tensor):
Tensor of shape (N, 3) giving the query points (N points in 3D space). -
serial_orders(List[str]):
Serialization orders to use, e.g.,["z"],["z", "hilbert"], etc.
Using multiple orders can improve neighbor search accuracy. -
k_neighbors(int):
Number of nearest neighbors to find for each query point. -
grid_size(float, optional):
Grid cell size for point discretization.
Smaller values give more accurate results but slower performance. Default:0.01 -
mask_threshold(float, optional):
Maximum distance threshold. Neighbors farther than this will be masked with-1.
Default:None
Returns:
-
combined_idx(LongTensor):
Shape: (N, K * O)
Indices of the nearest neighbors for each query point.
O is the number of serial orders used. Invalid neighbors are marked as-1. -
neighbor_dists(Tensor):
Shape: (N, K * O)
Euclidean distances to the neighbors.
🧪 Usage Example
import torch
from serial_neighbor import serial_neighbor
points = torch.rand(1000, 3).cuda()
query_xyz = torch.rand(100, 3).cuda()
idx, dists = serial_neighbor(points, query_xyz, ["z"], k_neighbors=8)
print("Neighbor indices:", idx.shape)
print("Neighbor distances:", dists.shape)
📄 Based on NoKSR
This module is part of the work described in the paper:
NoKSR: Kernel-Free Neural Surface Reconstruction via Point Cloud Serialization
Zhen Li, Weiwei Sun †, Shrisudhan Govindarajan, Shaobo Xia, Daniel Rebain, Kwang Moo Yi, Andrea Tagliasacchi
📄 Paper | 🔗 Project Page
We present a novel approach to large-scale point cloud surface reconstruction by converting an irregular point cloud into a signed distance field (SDF) through serialization-based neighbor search. This framework achieves state-of-the-art performance in both accuracy and efficiency, particularly on large-scale outdoor datasets.
📰 News
- [2025/03/22] The package
serial-neighboris released. - [2025/02/21] Code released!
- [2025/02/19] ArXiv version is released.
📬 Contact
For questions, comments, or bug reports, please contact:
Zhen Li (SFU) – zhen_li@sfu.ca
🛡 License
This project is licensed under the Apache License 2.0 – see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serial_neighbor-0.1.1.tar.gz.
File metadata
- Download URL: serial_neighbor-0.1.1.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfb1fe75aed337fde2d5472d73054ffff2577abc7eb5872fbddb2244fae3e157
|
|
| MD5 |
7ca4cf92d5ba701df2733c522271e0c7
|
|
| BLAKE2b-256 |
5e82b6edf49212c713ff57f8f36e3f07a2253b72ce593816c918a99f053f6320
|
File details
Details for the file serial_neighbor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: serial_neighbor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1e2c8ac8469f9fe8d5745a7598624dd295985f929af0905e3cafc5e866fd416
|
|
| MD5 |
0ed69eaff0112aae03d95ad7338f63c7
|
|
| BLAKE2b-256 |
953257587ef2288faeaba4c8ccf83d062a5a664a616b86c78fd091e4659b12ab
|