Skip to content

Commit

Permalink
new numpyeigen version and fix to chamfer distance for non batched ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
fwilliams committed Aug 2, 2019
1 parent 76805d6 commit b6cd454
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(EXTERNAL_DEP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
include(DownloadExternalDeps)
download_dep(numpyeigen
GIT_REPOSITORY https://github.com/fwilliams/numpyeigen.git
GIT_TAG 6db66f68b9f94ca8e8ddb569af33daa72bb6a810
GIT_TAG cc6e629930317c709fbb5fa29486f0b324786d09
)
list(APPEND CMAKE_MODULE_PATH ${EXTERNAL_DEP_DIR}/numpyeigen/cmake)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down
5 changes: 3 additions & 2 deletions point_cloud_utils/sinkhorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def chamfer(a, b):
:param b: A m-sized minibatch of point sets in R^d. i.e. shape [m, n_b, d]
:return: A [m] shaped tensor storing the Chamfer distance between each minibatch entry
"""
M = pairwise_distances(a, b, squeeze=False)
print(M.shape)
M = pairwise_distances(a, b)
if len(M.shape) == 2:
M = M[np.newaxis, :, :]
return M.min(1).sum(1) + M.min(2).sum(1)


Expand Down

0 comments on commit b6cd454

Please sign in to comment.