Skip to content

Instantly share code, notes, and snippets.

@dgtlmoon
Created November 14, 2016 21:37
Show Gist options
  • Save dgtlmoon/b4836792b1cbc41f6bda66c834f22798 to your computer and use it in GitHub Desktop.
Save dgtlmoon/b4836792b1cbc41f6bda66c834f22798 to your computer and use it in GitHub Desktop.
Rough LSH python benchmark of potential ORB descriptors
from lshash import LSHash
import numpy
import time
lsh = LSHash(100, 200, 1, None, "hamming.npz")
# Very modest
# lets assume 5000 images, with 200 features and 200 binary descriptors each
for y in range(0, 5000):
for x in range(0, 200):
lsh.index(numpy.random.randint(2, size=(200,)), y)
for r in range(0,10):
now = time.time()
lsh.query(numpy.random.randint(2, size=(200,)), 10, "hamming")
print time.time()-now
# 1.9097840786
# 2.78951191902
# 0.34514093399
# 1.41738390923
# 2.75403499603
# 1.3472340107
# 3.9218878746
# 0.842194795609
# 1.44249796867
# 1.45863008499
@dgtlmoon
Copy link
Author

dgtlmoon commented Nov 14, 2016

20,000 image sets (200*200 binary feature per image)

6.6Gb RAM usage

10285 root      20   0 7289292 6.607g   5616 R  99.7 42.5   2:03.41 python   

timing in Seconds per single query (200* would be required, one for each feature?)

16.2959368229
1.22037315369
1.19355297089
4.36228394508
5.90254998207
1.46862792969
17.2071578503
4.79945707321
6.87375688553
16.2232999802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment