Registry / ai-ml / fpsample

fpsample

JSON →
library1.0.2pypypi✓ verified 90d ago

An efficient CPU implementation of farthest point sampling (FPS) for point clouds, version 1.0.2. Provides fast FPS on CPU without GPU dependencies. Release cadence is low; no recent updates.

pip install fpsample
INSTALL
IMPORT
SIG · FPSAMPLE
F
fpsample
ai-mlpythonv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fpsample
✓ import fpsample
No common wrong import; the package exposes a single module.

Sample a subset of points from a point cloud using farthest point sampling.

import numpy as np import fpsample # Generate random point cloud: N x D (e.g., N=1000, D=3) points = np.random.rand(1000, 3).astype(np.float32) # Sample 10 points using farthest point sampling indices = fpsample.fps_sampling(points, 10) print(indices)
Debug
Known issues
gotchaThe input point cloud must be a 2D numpy array of shape (N, D) with dtype float32. Other dtypes (e.g., float64) may cause errors or performance issues.
fix
Convert input to float32 with points.astype(np.float32).
affects: all
gotchaThe function fps_sampling returns 0-based indices. Do not assume 1-based indexing.
fix
Use the returned indices as 0-based array indices.
affects: all
deprecatedThe function fps_sample is deprecated and may be removed in a future release. Use fps_sampling instead.
fix
Replace fps_sample with fps_sampling.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: 'numpy.float64' object cannot be interpreted as an integer
Input array has dtype float64, which is not supported.
fix
Convert input to float32: points = points.astype(np.float32)
ValueError: points must be a 2D array
Input is not a 2D numpy array (e.g., 1D or 3D).
fix
Ensure point cloud is a 2D array of shape (N, D).
Upgrade
Version history
1.0.2latest on PyPI · released Dec 20, 2025
Audit
Dependencies
numpyrequiredRequired for array operations and point cloud representation.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
fpsample — pip install fpsample · libregistry