Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
akapet00 committed Apr 7, 2023
1 parent 2f17329 commit 502eafc
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 37 deletions.
194 changes: 162 additions & 32 deletions benchmark.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def weight(p, nbhd, kernel='rbf', sigma=None):
if kernel == 'rbf': # Gaussian
w = np.exp(-dist ** 2 / (2 * sigma ** 2))
elif kernel == 'cosine':
w = (X @ p) / np.linalg.norm(nbhd * p, axis=1)
w = (nbhd @ p) / np.linalg.norm(nbhd * p, axis=1)
elif kernel == 'linear':
w = np.maximum(1 - sigma * dist, 0)
elif kernel == 'inverse':
Expand Down
5 changes: 2 additions & 3 deletions src/orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def orient_normals_cvx(xyz, n):
----------
xyz : numpy.ndarray
The point cloud of shape (N, 3), N is the number of points.
n : numpy.ndsarray
n : numpy.ndarray
The unit normals of shape (N, 3), where N is the number of
points in the point cloud.
Expand Down Expand Up @@ -77,7 +77,6 @@ def _compute_kgraph(xyz, k):
----------
xyz : numpy.ndarray
The point cloud of shape (N, 3), N is the number of points.
n : numpy.ndsarray
k : int
Number of k nearest neighbors used in constructing the
Riemannian graph used to propagate normal orientation.
Expand All @@ -98,7 +97,7 @@ def _compute_rmst(xyz, n, k, eps=1e-4):
----------
xyz : numpy.ndarray
The point cloud of shape (N, 3), N is the number of points.
n : numpy.ndsarray
n : numpy.ndarray
The unit normals of shape (N, 3), where N is the number of
points in the point cloud.
k : int
Expand Down
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ def polyfit2d(x, y, z, deg=1, rcond=None, full_output=False):
coef, res, rank, s = np.linalg.lstsq(A, b, rcond=rcond)
if full_output:
return coef.reshape(deg+1, deg+1), res, rank, s
return coef.reshape(deg+1, deg+1)
return coef.reshape(deg+1, deg+1)

0 comments on commit 502eafc

Please sign in to comment.