A PyTorch implementation of the RIMLS reconstruction algorithm.
Project description
Robust Implicit Moving Least Squares in PyTorch
The package has been released on pypi and can be installed with the following:
pip install pyRIMLS
Quick Start:
import torch
import pyrimls as pyr
from diso import DiffMC
import tqdm
reconstructor = pyr.RobustImplicitMLS()
differentiable_marching_cubes = DiffMC(dtype=torch.float32)
# (1) Setup the pointcloud data
points, normals = torch.from_numpy(points).float(), torch.from_numpy(normals).float()
# (2) Setup the MC grid
min_plc, max_plc = -1, 1 # Bounds of the marching cube box.
N = 100 # march cubes resolution
grid_points = torch.stack(torch.meshgrid(torch.linspace(min_plc, max_plc, N),
torch.linspace(min_plc, max_plc, N),
torch.linspace(min_plc, max_plc, N)),
dim=-1)
grid_points = grid_points.reshape(-1, 3)
# (3) Compute the potential/SDF values
batch_size = 10000
values = []
for i in tqdm(range(0, len(grid_points), batch_size)):
batch = grid_points[i:i+batch_size]
potential = reconstructor.potential(batch, points, normals)
values.append(potential)
sdf = torch.cat(values)
sdf = sdf.reshape(N, N, N)
# (4) Marching cubes
verts, faces = differentiable_marching_cubes(sdf, None, isovalue=0)
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
pyrimls-0.0.2.tar.gz
(4.4 kB
view details)
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 pyrimls-0.0.2.tar.gz.
File metadata
- Download URL: pyrimls-0.0.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5742bde5c65b89d23765d28f22c082fb097b610495cd7710705a5992d988c09c
|
|
| MD5 |
7e61eaaf64a26429775c38e131b16197
|
|
| BLAKE2b-256 |
18c2cc93f9570d026715f17420ebc558eb4084204d29b9f69bad1b913734355b
|
File details
Details for the file pyrimls-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pyrimls-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca9a8aa0d840703531322181cc2ec46ee7ffc24d935fad10039c4137d35b35c2
|
|
| MD5 |
b419100e7a66ba3251f5463b25594c69
|
|
| BLAKE2b-256 |
8ced4f4d79f2f829d8e29d8af06ceeb9666015ccb2b93fc5ab980d5543d970e8
|