fix self assign for normals est

Summary: Fix self assignment of normals when estimating normals

Reviewed By: nikhilaravi

Differential Revision: D21315980

fbshipit-source-id: 2aa5864c3f066e39e07343f192cc6423ce1ae771
This commit is contained in:
Georgia Gkioxari
2020-04-30 14:24:23 -07:00
committed by Facebook GitHub Bot
parent 686c8666d3
commit e64e0d17ef
2 changed files with 47 additions and 14 deletions

View File

@@ -382,11 +382,9 @@ class Pointclouds(object):
if self._normals_padded is None:
# No normals provided so return None
return None
self._normals_list = []
for i in range(self._N):
self._normals_list.append(
self._normals_padded[i, : self.num_points_per_cloud()[i]]
)
self._normals_list = struct_utils.padded_to_list(
self._normals_padded, self.num_points_per_cloud().tolist()
)
return self._normals_list
def features_list(self):
@@ -400,11 +398,9 @@ class Pointclouds(object):
if self._features_padded is None:
# No features provided so return None
return None
self._features_list = []
for i in range(self._N):
self._features_list.append(
self._features_padded[i, : self.num_points_per_cloud()[i]]
)
self._features_list = struct_utils.padded_to_list(
self._features_padded, self.num_points_per_cloud().tolist()
)
return self._features_list
def points_packed(self):
@@ -887,9 +883,14 @@ class Pointclouds(object):
# assign to self
if assign_to_self:
self._normals_list, self._normals_padded, _ = self._parse_auxiliary_input(
normals_est
)
_, self._normals_padded, _ = self._parse_auxiliary_input(normals_est)
self._normals_list, self._normals_packed = None, None
if self._points_list is not None:
# update self._normals_list
self.normals_list()
if self._points_packed is not None:
# update self._normals_packed
self._normals_packed = torch.cat(self._normals_list, dim=0)
return normals_est