Created
January 17, 2012 19:27
-
-
Save fish2000/1628330 to your computer and use it in GitHub Desktop.
Trivial FLANN example snippet in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyflann import * | |
from numpy import * | |
from numpy.random import * | |
dataset = rand(10000, 128) | |
testset = rand(1000, 128) | |
flann = FLANN() | |
result,dists = flann.nn(dataset,testset,5,algorithm="kmeans", | |
branching=32, iterations=7, checks=16) | |
print '' | |
print 'RESULT %s : ' % str(result.shape) | |
print result | |
print '' | |
print 'DISTS %s : ' % str(dists.shape) | |
print dists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment