semvec/pypi-packages huggingface dataset:
alto-pointcloud 0.1.1
Point clouds batched processing
License: Apache-2.0
Requires Python: ~=3.8

# Alto

Alto is a simple library to process and augment batches of point clouds.

# Documentation

A documentation, containing full api reference as well as small showcases is available [here](https://spfluosmlm.github.io/Alto/).


## What does it provide

- **Clarity**: the API is in the style of *Albumentations*: every transformation has a determinist, functional implementation, and its probabilist, class counterpart. Classes Transforms are arbitrarely composables.
- **Rapidity**: Every operations in Alto is batched, resulting in heavily time efficient / memory consuming workloads. (See the benchmark notebook in examples/).



## Installation

```
pip install alto-pointcloud
```
requires python 3.8 and open3d 0.10+.


## Basic usage


```python

from alto import Compose
from alto import RandomScale, RandomSample, RandomRotate, RandomTranslate
from alto import AddRandomOutliers, AddRandomAnisotropicNoise


preprocess = Compose((
    RandomScale(range=(0.8, 1.2), p=0.5),
    RandomSample(range=(0.7, 0.9), p=1),
    RandomTranslate(range=(0.1, 0.5), p=0.8),
    RandomRotate(range=(0, 0, 45, 90, 0, 45), convention='zxz', p=1),
), p=1)


augment = Compose((
    AddRandomOutliers(ratio=(0.05, 0.1), scale=(0, 1.5)),
    AddRandomAnisotropicNoise(uncertainty=0.05, anisotropy=(1, 1, 5), noise_uncertainty=0.01),
))


# source: (batch_size, num_points, spatial_dim)
# target: (batch_size, num_points, spatial_dim)
source, target = next(iter(dataloader))


# any name and number of arguments are usable in the call to a Transform.
preprocessed = preprocess(source=source, target=target)
source, target = preprocessed['source'], preprocessed['target']
augmented = augment(source=source)
source = augmented['source'] 
```