Skip to content

Instantly share code, notes, and snippets.

@fish2000
Created January 17, 2012 19:27
Show Gist options
  • Save fish2000/1628330 to your computer and use it in GitHub Desktop.
Save fish2000/1628330 to your computer and use it in GitHub Desktop.
Trivial FLANN example snippet in Python
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