mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 11:52:50 +08:00
lint fixes
Summary: Resolved trailing whitespace warnings. Reviewed By: gkioxari Differential Revision: D21023982 fbshipit-source-id: 14ea2ca372c13cfa987acc260264ca99ce44c461
This commit is contained in:
parent
3794f6753f
commit
b530b0af32
@ -41,10 +41,10 @@ class _PointFaceDistance(Function):
|
|||||||
in the corresponding example in the batch
|
in the corresponding example in the batch
|
||||||
idxs: LongTensor of shape `(P,)` indicating the closest triangular face
|
idxs: LongTensor of shape `(P,)` indicating the closest triangular face
|
||||||
in the corresponindg example in the batch.
|
in the corresponindg example in the batch.
|
||||||
|
|
||||||
`dists[p] = d(points[p], tris[idxs[p], 0], tris[idxs[p], 1], tris[idxs[p], 2])`
|
`dists[p] = d(points[p], tris[idxs[p], 0], tris[idxs[p], 1], tris[idxs[p], 2])`
|
||||||
where `d(u, v0, v1, v2)` is the distance of point `u` from the trianfular face `(v0, v1, v2)`
|
where `d(u, v0, v1, v2)` is the distance of point `u` from the trianfular face `(v0, v1, v2)`
|
||||||
|
|
||||||
"""
|
"""
|
||||||
dists, idxs = _C.point_face_dist_forward(
|
dists, idxs = _C.point_face_dist_forward(
|
||||||
points, points_first_idx, tris, tris_first_idx, max_points
|
points, points_first_idx, tris, tris_first_idx, max_points
|
||||||
@ -91,7 +91,7 @@ class _FacePointDistance(Function):
|
|||||||
corresponding example in the batch
|
corresponding example in the batch
|
||||||
idxs: LongTensor of shape `(T,)` indicating the closest point in the
|
idxs: LongTensor of shape `(T,)` indicating the closest point in the
|
||||||
corresponindg example in the batch.
|
corresponindg example in the batch.
|
||||||
|
|
||||||
`dists[t] = d(points[idxs[t]], tris[t, 0], tris[t, 1], tris[t, 2])`,
|
`dists[t] = d(points[idxs[t]], tris[t, 0], tris[t, 1], tris[t, 2])`,
|
||||||
where `d(u, v0, v1, v2)` is the distance of point `u` from the triangular
|
where `d(u, v0, v1, v2)` is the distance of point `u` from the triangular
|
||||||
face `(v0, v1, v2)`.
|
face `(v0, v1, v2)`.
|
||||||
@ -141,7 +141,7 @@ class _PointEdgeDistance(Function):
|
|||||||
corresponding example in the batch
|
corresponding example in the batch
|
||||||
idxs: LongTensor of shape `(P,)` indicating the closest edge in the
|
idxs: LongTensor of shape `(P,)` indicating the closest edge in the
|
||||||
corresponindg example in the batch.
|
corresponindg example in the batch.
|
||||||
|
|
||||||
`dists[p] = d(points[p], segms[idxs[p], 0], segms[idxs[p], 1])`,
|
`dists[p] = d(points[p], segms[idxs[p], 0], segms[idxs[p], 1])`,
|
||||||
where `d(u, v0, v1)` is the distance of point `u` from the edge segment
|
where `d(u, v0, v1)` is the distance of point `u` from the edge segment
|
||||||
spanned by `(v0, v1)`.
|
spanned by `(v0, v1)`.
|
||||||
@ -191,7 +191,7 @@ class _EdgePointDistance(Function):
|
|||||||
corresponding example in the batch
|
corresponding example in the batch
|
||||||
idxs: LongTensor of shape `(S,)` indicating the closest point in the
|
idxs: LongTensor of shape `(S,)` indicating the closest point in the
|
||||||
corresponindg example in the batch.
|
corresponindg example in the batch.
|
||||||
|
|
||||||
`dists[s] = d(points[idxs[s]], edges[s, 0], edges[s, 1])`,
|
`dists[s] = d(points[idxs[s]], edges[s, 0], edges[s, 1])`,
|
||||||
where `d(u, v0, v1)` is the distance of point `u` from the segment
|
where `d(u, v0, v1)` is the distance of point `u` from the segment
|
||||||
spanned by `(v0, v1)`.
|
spanned by `(v0, v1)`.
|
||||||
@ -226,7 +226,7 @@ def point_mesh_edge_distance(meshes: Meshes, pcls: Pointclouds):
|
|||||||
to the closest edge segment in mesh and averages across all points in pcl
|
to the closest edge segment in mesh and averages across all points in pcl
|
||||||
`edge_point(mesh, pcl)`: Computes the squared distance of each edge segment in mesh
|
`edge_point(mesh, pcl)`: Computes the squared distance of each edge segment in mesh
|
||||||
to the closest point in pcl and averages across all edges in mesh.
|
to the closest point in pcl and averages across all edges in mesh.
|
||||||
|
|
||||||
The above distance functions are applied for all `(mesh, pcl)` pairs in the batch and
|
The above distance functions are applied for all `(mesh, pcl)` pairs in the batch and
|
||||||
then averaged across the batch.
|
then averaged across the batch.
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ def point_mesh_face_distance(meshes: Meshes, pcls: Pointclouds):
|
|||||||
to the closest triangular face in mesh and averages across all points in pcl
|
to the closest triangular face in mesh and averages across all points in pcl
|
||||||
`face_point(mesh, pcl)`: Computes the squared distance of each triangular face in mesh
|
`face_point(mesh, pcl)`: Computes the squared distance of each triangular face in mesh
|
||||||
to the closest point in pcl and averages across all faces in mesh.
|
to the closest point in pcl and averages across all faces in mesh.
|
||||||
|
|
||||||
The above distance functions are applied for all `(mesh, pcl)` pairs in the batch and
|
The above distance functions are applied for all `(mesh, pcl)` pairs in the batch and
|
||||||
then averaged across the batch.
|
then averaged across the batch.
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ def knn_points(
|
|||||||
p1_dists: Tensor of shape (N, P1, K) giving the squared distances to
|
p1_dists: Tensor of shape (N, P1, K) giving the squared distances to
|
||||||
the nearest neighbors. This is padded with zeros both where a cloud in p2
|
the nearest neighbors. This is padded with zeros both where a cloud in p2
|
||||||
has fewer than K points and where a cloud in p1 has fewer than P1 points.
|
has fewer than K points and where a cloud in p1 has fewer than P1 points.
|
||||||
|
|
||||||
p2_nn: Tensor of shape (N, P1, K, D) giving the K nearest neighbors in p2 for
|
p2_nn: Tensor of shape (N, P1, K, D) giving the K nearest neighbors in p2 for
|
||||||
each point in p1. Concretely, `p2_nn[n, i, k]` gives the k-th nearest neighbor
|
each point in p1. Concretely, `p2_nn[n, i, k]` gives the k-th nearest neighbor
|
||||||
for `p1[n, i]`. Returned if `return_nn` is True.
|
for `p1[n, i]`. Returned if `return_nn` is True.
|
||||||
@ -134,7 +134,7 @@ def knn_points(
|
|||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
p2_nn = knn_gather(p2, p1_idx, lengths2)
|
p2_nn = knn_gather(p2, p1_idx, lengths2)
|
||||||
|
|
||||||
which is a helper function that allows indexing any tensor of shape (N, P2, U) with
|
which is a helper function that allows indexing any tensor of shape (N, P2, U) with
|
||||||
the indices `p1_idx` returned by `knn_points`. The outout is a tensor
|
the indices `p1_idx` returned by `knn_points`. The outout is a tensor
|
||||||
of shape (N, P1, K, U).
|
of shape (N, P1, K, U).
|
||||||
@ -168,7 +168,7 @@ def knn_gather(
|
|||||||
"""
|
"""
|
||||||
A helper function for knn that allows indexing a tensor x with the indices `idx`
|
A helper function for knn that allows indexing a tensor x with the indices `idx`
|
||||||
returned by `knn_points`.
|
returned by `knn_points`.
|
||||||
|
|
||||||
For example, if `dists, idx = knn_points(p, x, lengths_p, lengths, K)`
|
For example, if `dists, idx = knn_points(p, x, lengths_p, lengths, K)`
|
||||||
where p is a tensor of shape (N, L, D) and x a tensor of shape (N, M, D),
|
where p is a tensor of shape (N, L, D) and x a tensor of shape (N, M, D),
|
||||||
then one can compute the K nearest neighbors of p with `p_nn = knn_gather(x, idx, lengths)`.
|
then one can compute the K nearest neighbors of p with `p_nn = knn_gather(x, idx, lengths)`.
|
||||||
|
@ -132,7 +132,7 @@ class TestPointMeshDistance(TestCaseMixin, unittest.TestCase):
|
|||||||
edge: FloatTensor of shape (2, 3)
|
edge: FloatTensor of shape (2, 3)
|
||||||
Returns:
|
Returns:
|
||||||
dist: FloatTensor of shape (1)
|
dist: FloatTensor of shape (1)
|
||||||
|
|
||||||
If a, b are the start and end points of the segments, we
|
If a, b are the start and end points of the segments, we
|
||||||
parametrize a point p as
|
parametrize a point p as
|
||||||
x(t) = a + t * (b - a)
|
x(t) = a + t * (b - a)
|
||||||
@ -165,7 +165,7 @@ class TestPointMeshDistance(TestCaseMixin, unittest.TestCase):
|
|||||||
point: FloatTensor of shape (3)
|
point: FloatTensor of shape (3)
|
||||||
tri: FloatTensor of shape (3, 3)
|
tri: FloatTensor of shape (3, 3)
|
||||||
Returns:
|
Returns:
|
||||||
dist: FloatTensor of shape (1)
|
dist: FloatTensor of shape (1)
|
||||||
"""
|
"""
|
||||||
a, b, c = tri.unbind(0)
|
a, b, c = tri.unbind(0)
|
||||||
cross = torch.cross(b - a, c - a)
|
cross = torch.cross(b - a, c - a)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user