Rotation vector
beignet.apply_rotation_vector
apply_rotation_vector(input, rotation, degrees=False, inverse=False)
Rotates vectors in three-dimensional space using rotation vectors.
Note
This function interprets the rotation of the original frame to the final frame as either a projection, where it maps the components of vectors from the final frame to the original frame, or as a physical rotation, integrating the vectors into the original frame during the rotation process. Consequently, the vector components are maintained in the original frame’s perspective both before and after the rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
(Tensor, shape(..., 3))
|
Each vector represents a vector in three-dimensional space. The number of rotation vectors and number of vectors must follow standard broadcasting rules: either one of them equals unity or they both equal each other. |
required |
rotation
|
(Tensor, shape(..., 4))
|
Rotation vectors. |
required |
degrees
|
bool
|
If |
False
|
inverse
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Rotated vectors. |
Source code in src/beignet/_apply_rotation_vector.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
beignet.compose_rotation_vector
compose_rotation_vector(input, other, degrees=False)
Compose rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 4)
|
Rotation vectors. |
required |
other
|
Tensor, shape=(..., 4)
|
Rotation vectors. |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Composed rotation vectors. |
Source code in src/beignet/_compose_rotation_vector.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
beignet.invert_rotation_vector
invert_rotation_vector(input)
Invert rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
(Tensor, shape(..., 3))
|
Rotation vectors. |
required |
Returns:
Name | Type | Description |
---|---|---|
inverted_rotation_vectors |
(Tensor, shape(..., 3))
|
Inverted rotation vectors. |
Source code in src/beignet/_invert_rotation_vector.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
beignet.random_rotation_vector
random_rotation_vector(size, degrees=False, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)
Generate random rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
int
|
Output size. |
required |
degrees
|
bool
|
|
False
|
generator
|
Generator
|
Psuedo-random number generator. Default, |
None
|
out
|
Tensor
|
Output tensor. Default, |
None
|
dtype
|
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout
|
layout
|
Layout of the returned tensor. Default, |
strided
|
device
|
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad
|
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
pin_memory
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
random_rotation_vectors |
(Tensor, shape(..., 3))
|
Random rotation vectors. |
Source code in src/beignet/_random_rotation_vector.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
beignet.rotation_vector_identity
rotation_vector_identity(size, degrees=False, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
int
|
Output size. |
required |
degrees
|
bool
|
If |
False
|
out
|
Tensor
|
Output tensor. Default, |
None
|
dtype
|
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout
|
layout
|
Layout of the returned tensor. Default, |
strided
|
device
|
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad
|
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
identity_rotation_vectors |
(Tensor, shape(size, 3))
|
Identity rotation vectors. |
Source code in src/beignet/_rotation_vector_identity.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
beignet.rotation_vector_magnitude
rotation_vector_magnitude(input, degrees=False)
Rotation vector magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
(Tensor, shape(..., 3))
|
Rotation vectors. |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
rotation_vector_magnitudes |
(Tensor, shape(...))
|
Angles in radians. Magnitudes will be in the range :math: |
Source code in src/beignet/_rotation_vector_magnitude.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
beignet.rotation_vector_mean
rotation_vector_mean(input, weight=None, degrees=False)
Compose rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 4)
|
Rotation vectors. |
required |
weight
|
Tensor, shape=(..., 4)
|
Relative importance of rotation matrices. |
None
|
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation vectors mean. |
Source code in src/beignet/_rotation_vector_mean.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
beignet.rotation_vector_to_euler_angle
rotation_vector_to_euler_angle(input, axes, degrees=False)
Convert rotation vectors to Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Rotation vectors. |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Euler angles. The returned Euler angles are in the range:
|
Source code in src/beignet/_rotation_vector_to_euler_angle.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
beignet.rotation_vector_to_quaternion
rotation_vector_to_quaternion(input, degrees=False, canonical=False)
Convert rotation vector to rotation quaternion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Rotation vector. |
required |
degrees
|
bool
|
If |
False
|
canonical
|
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation quaternion. |
Source code in src/beignet/_rotation_vector_to_quaternion.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
beignet.rotation_vector_to_rotation_matrix
rotation_vector_to_rotation_matrix(input, degrees=False)
Convert rotation vectors to rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Rotation vectors. |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
Source code in src/beignet/_rotation_vector_to_rotation_matrix.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|