Commit 89dc341b authored by rusty1s's avatar rusty1s
Browse files

changed readme structure

parent 25e2ab48
...@@ -14,10 +14,26 @@ ...@@ -14,10 +14,26 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
This package consists of a small extension library of highly optimised graph cluster algorithms for the use in [PyTorch](http://pytorch.org/). This package consists of a small extension library of highly optimised graph cluster algorithms for the use in [PyTorch](http://pytorch.org/).
All included operations work on varying data types and are implemented both for CPU and GPU.
The package consists of the following operations: The package consists of the following operations:
* **Graclus:** Greedy clustering algorithm of picking an unmarked vertex and matching it with one its unmarked neighbors (that maximizes its edge weight). * **[Graclus](#graclus)**
* **[VoxelGrid](#voxelgrid)**
All included operations work on varying data types and are implemented both for CPU and GPU.
## Installation
Check that `nvcc` is accessible from terminal, e.g. `nvcc --version`.
If not, add cuda (`/usr/local/cuda/bin`) to your `$PATH`.
Then run:
```
pip install cffi torch-cluster
```
## Graclus
A greedy clustering algorithm of picking an unmarked vertex and matching it with one its unmarked neighbors (that maximizes its edge weight).
```python ```python
import torch import torch
...@@ -36,7 +52,9 @@ print(cluster) ...@@ -36,7 +52,9 @@ print(cluster)
[torch.LongTensor of size 3] [torch.LongTensor of size 3]
``` ```
* **Grid:** Voxel grid clustering algorithm, which overlays a regular grid of user-defined size over the point cloud and clusters all points within a voxel. ## VoxelGrid
A clustering algorithm, which overlays a regular grid of user-defined size over a point cloud and clusters all points within a voxel.
```python ```python
import torch import torch
...@@ -54,16 +72,6 @@ print(cluster) ...@@ -54,16 +72,6 @@ print(cluster)
[torch.LongTensor of size 5] [torch.LongTensor of size 5]
``` ```
## Installation
Check that `nvcc` is accessible from terminal, e.g. `nvcc --version`.
If not, add cuda (`/usr/local/cuda/bin`) to your `$PATH`.
Then run:
```
pip install cffi torch-cluster
```
## Running tests ## Running tests
``` ```
......
...@@ -3,7 +3,7 @@ from .utils.ffi import graclus ...@@ -3,7 +3,7 @@ from .utils.ffi import graclus
def graclus_cluster(row, col, weight=None, num_nodes=None): def graclus_cluster(row, col, weight=None, num_nodes=None):
"""Greedy clustering algorithm of picking an unmarked vertex and matching """A greedy clustering algorithm of picking an unmarked vertex and matching
it with one its unmarked neighbors (that maximizes its edge weight). it with one its unmarked neighbors (that maximizes its edge weight).
Args: Args:
......
...@@ -2,9 +2,8 @@ from .utils.ffi import grid ...@@ -2,9 +2,8 @@ from .utils.ffi import grid
def grid_cluster(pos, size, start=None, end=None): def grid_cluster(pos, size, start=None, end=None):
"""Voxel grid clustering algorithm, which overlays a regular grid of """A clustering algorithm, which overlays a regular grid of user-defined
user-defined size over the point cloud and clusters all points within a size over a point cloud and clusters all points within a voxel.
voxel.
Args: Args:
pos (Tensor): D-dimensional position of points. pos (Tensor): D-dimensional position of points.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment