Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bindings #98

Open
mikeagn opened this issue Nov 27, 2019 · 0 comments
Open

Python bindings #98

mikeagn opened this issue Nov 27, 2019 · 0 comments

Comments

@mikeagn
Copy link

mikeagn commented Nov 27, 2019

I am trying to use the python bindings of the library and run the simple example that is provided (libnabo/python/test.py). However, I cannot, since when the user defines the query point: q = np.array([[1.1, 2.]]) it there is a runtime error:
RuntimeError: Query has less dimensions (1) than requested for cloud (2)

I guess that has something to do with the dimension of the query point. If I transpose the query point I get a correct answer but does this make sense?:

res = nns.knn(q.transpose(), 2, 0, SearchOptionFlags.ALLOW_SELF_MATCH)
res
(array([[1, 0]], dtype=int32), array([[0.01, 2.21]]))

Can you please help advise on how to use the python bindings, or maybe update the example with a working one?
Many thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant