PyTorch toolbox to work with spherical surfaces.
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.
-
class
surfify.augmentation.SphericalRandomRotation(vertices, triangles, angles=(5, 0, 0), fixed_angle=True, interpolation='barycentric', cachedir=None)[source]¶ Rotation of the icosahedron’s vertices.
See also
rotate_dataExamples
>>> from surfify.utils import icosahedron >>> from surfify.datasets import make_classification >>> from surfify.augmentation import SphericalRandomRotation >>> import matplotlib.pyplot as plt >>> from surfify.plotting import plot_trisurf >>> ico3_verts, ico3_tris = icosahedron(order=3) >>> X, y = make_classification(ico3_verts, n_samples=1, n_classes=3, scale=1, seed=42) >>> processor = SphericalRandomRotation( ico3_verts, ico3_tris, angles=(45, 0, 0)) >>> y_rot = processor(y) >>> plot_trisurf(ico3_verts, triangles=ico3_tris, texture=y_rot, is_label=False) >>> plt.show()
-
__init__(vertices, triangles, angles=(5, 0, 0), fixed_angle=True, interpolation='barycentric', cachedir=None)[source]¶ Init class.
- Parameters
vertices : array (N, 3)
icosahedron’s vertices.
triangles : array (M, 3)
icosahdron’s triangles.
angles : 3-uplet, default (5, 0, 0)
the rotation angles intervals in degrees for each axis (Euler representation).
fixed_angle : bool, default True
if True changes the angle of the rotation at each call. This option slows down the training as the rotation needs to be initialiazed at each call
interpolation : str, default ‘barycentric’
type of interpolation to use by the rotate_data function, see rotate_data.
cachedir : str, default None
set this folder to use smart caching speedup.
-
Follow us