Skip to content

Cython iterative farthest point sampling implementation

Notifications You must be signed in to change notification settings

jackd/ifp-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Approximate Iterative Farthest Point Sampling

Cython implementation based on pre-computed distances (e.g. from a KDTree) using a priority queue.

Installation

pip install Cython
pip install git+git://github.com/jackd/ifp-sample.git

Or if you want to make changes:

git clone https://github.com/jackd/ifp-sample.git
pip install -e ifp-sample

Usage

import numpy as np
from scipy.spatial import cKDTree
from ifp import ifp_sample

coords = np.random.uniform(size=(1024, 3))
dists, indices = cKDTree(coords).query(coords, 8)
sampled_indices = ifp_sample(dists, indices, num_out=512)
sampled_coords = coords[sampled_indices]

See example.py for basic benchmark (~3x faster than pure python version).

About

Cython iterative farthest point sampling implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages