mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-02-07 14:52:21 +08:00
Add annotations to vision/fair/pytorch3d
Reviewed By: shannonzhu Differential Revision: D35513897 fbshipit-source-id: 1ca12671df1bd6608a7dce9193c145d5985c0b45
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3809b6094c
commit
4b94649f7b
@@ -167,7 +167,7 @@ def estimate_pointcloud_local_coord_frames(
|
||||
return curvatures, local_coord_frames
|
||||
|
||||
|
||||
def _disambiguate_vector_directions(pcl, knns, vecs):
|
||||
def _disambiguate_vector_directions(pcl, knns, vecs: float) -> float:
|
||||
"""
|
||||
Disambiguates normal directions according to [1].
|
||||
|
||||
@@ -181,6 +181,7 @@ def _disambiguate_vector_directions(pcl, knns, vecs):
|
||||
# each element of the neighborhood
|
||||
df = knns - pcl[:, :, None]
|
||||
# projection of the difference on the principal direction
|
||||
# pyre-fixme[16]: `float` has no attribute `__getitem__`.
|
||||
proj = (vecs[:, :, None] * df).sum(3)
|
||||
# check how many projections are positive
|
||||
n_pos = (proj > 0).type_as(knns).sum(2, keepdim=True)
|
||||
|
||||
@@ -400,7 +400,7 @@ def create_verts_index(verts_per_mesh, edges_per_mesh, device=None):
|
||||
return verts_idx
|
||||
|
||||
|
||||
def create_faces_index(faces_per_mesh, device=None):
|
||||
def create_faces_index(faces_per_mesh: int, device=None):
|
||||
"""
|
||||
Helper function to group the faces indices for each mesh. New faces are
|
||||
stacked at the end of the original faces tensor, so in order to have
|
||||
@@ -417,7 +417,9 @@ def create_faces_index(faces_per_mesh, device=None):
|
||||
"""
|
||||
# e.g. faces_per_mesh = [2, 5, 3]
|
||||
|
||||
# pyre-fixme[16]: `int` has no attribute `sum`.
|
||||
F = faces_per_mesh.sum() # e.g. 10
|
||||
# pyre-fixme[16]: `int` has no attribute `cumsum`.
|
||||
faces_per_mesh_cumsum = faces_per_mesh.cumsum(dim=0) # (N,) e.g. (2, 7, 10)
|
||||
|
||||
switch1_idx = faces_per_mesh_cumsum.clone()
|
||||
|
||||
Reference in New Issue
Block a user