losses
Module containing loss functions.
nn_loss(points_from, points_to)
Compute the distance to the closest neighbor in the other set of points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
points_from |
Tensor
|
The first point set. Shape NxD, with N points of dimension D. |
required |
points_to |
Tensor
|
The second point set. Shape MxD, with M points of dimension D. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Squared distance from all points in the points_from set to the closest point in |
Tensor
|
points to set. Output shape is (N,). |
Source code in sdfest/estimation/losses.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
pc_loss(points, position, orientation, scale, sdf)
Compute trilinerly interpolated SDF value at point positions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
points |
Tensor
|
pointcloud in camera frame, shape (M, 4) |
required |
position |
Tensor
|
position of SDF center in camera frame, shape (3,) |
required |
orientation |
Tensor
|
quaternion representing orientation of SDF, shape (4,) |
required |
scale |
Tensor
|
half-width of SDF volume |
required |
sdf |
Tensor
|
volumetric signed distance field, shape (res, res, res), assuming same resolution along each axis |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Trilinearly interpolated distance at the passed points 0 if outside of SDF |
Tensor
|
volume. Distance is in world coordinates (i.e., after scaling the SDF). |
Source code in sdfest/estimation/losses.py
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
point_constraint_loss(orientation_q, source, target)
Compute Euclidean distance between rotated source point and target point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
orientation_q |
Tensor
|
Orientation of object in world / camera frame as quaternion. Scalar-last convention. Shape (4,). |
required |
source |
Tensor
|
Point in object frame, which will be transformed. (3,). |
required |
target |
Tensor
|
Point in rotated oject frame. Shape (3,). |
required |
Returns: Euclidean norm between R(orientation_q) @ source - target. Scalar.
Source code in sdfest/estimation/losses.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|