Skip to main content

Sparse local operations for point clouds in any dimension.

Project description


Open In Colab PyPI version Documentation Status

❒ SquareNet

SquareNet maps unstructured point clouds to structured grids through a bijective transformation. It replaces expensive spatial queries (k-NN, radius search) with super fast sliding window operations. Think of it as a powerful alternative to kd-trees, voxelization, rasterization and neighborhood graphs. ✔ Works in any dimension ✔ Handles non-convex geometries ✔ Scales to millions of points (fast processing) ✔ Support for Pytorch and Jax

Animation ✨

🚀 Why SquareNet?

  • Speed: $O(N)$ local operations via vectorized sliding windows.
  • Memory: Contiguous memory access instead of irregular spatial lookups.
  • Simplicity: No heavy spatial dependencies, pure native sorting logic

📦 Installation

pip install squarenet

🧠 Quick Start

-> 00_getting_started.ipynb

from squarenet import SquareNet
import numpy as np

# Initialize and Fit
N = 5*11*7*13
d = 4
X = np.random.rand(N, d)

IJKL = (5, 11, 7, 13)
sn = SquareNet(IJ_=IJKL) # Define grid dimensions, here 4D
sn.fit(x)

# Map any data indexed on the points e.g (N, *C) to the grid 
Xgrid = sn.map(X) #(5, 11, 7, 13, 4)
#and back
sn.invert_map(Xgrid)   # = X

Query neighbors

# d-dimensional query method
# approximate but super fast
sn.search_sorted(point) 

🗺️ Visualizing the Mapping

sn = SquareNet(IJ_=(400, 400))
sn.fit("france") 
sn.plot(style = "mesh")

📈 Key Applications

  • Point-Cloud Processing: Fast spatial querys (neighbors, intersections...).
  • Kernel Methods: Efficient approximation of large kernels (sparse Gram matrix).
  • Deep Learning: Tensorization of flat datasets (CNN-Ready)

Packed

-----

License: MIT | Author: ArmanddeCacqueray

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

squarenet-1.0.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squarenet-1.0.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file squarenet-1.0.0.tar.gz.

File metadata

  • Download URL: squarenet-1.0.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for squarenet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 78b5530d19b9968294ffe833d25f4788d87cd26f7a1870847e9bd267ed493394
MD5 3cc8298d211491156a6a50fccba4e2ca
BLAKE2b-256 d9fd7b63725aeb839e91e77dcab5d9e70bcb0e99e7cce7494016f9165e4d7662

See more details on using hashes here.

File details

Details for the file squarenet-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: squarenet-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for squarenet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95a6727cfb62c2d9f4a546efbfbb8fac96bf7e0e905f61676cb4ad62f4d15910
MD5 cab523ef7ab51055572897c669f49fe4
BLAKE2b-256 4e6b711deeb928706979c2af8d41a2e59b53e8866ac2ab57c4c7fb76256397c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page