Skip to content

Instantly share code, notes, and snippets.

from annoy import AnnoyIndex
index = AnnoyIndex(1)
for x in range(10000):
id = "%d000%d" % (x,x)
index.add_item(int(id),[x])
48000693
49000693
50000693
51000693
52000693
53000693
54000693
55000693
56000693
57000693
from math import sqrt
def confidence(ups, downs):
n = ups + downs
if n == 0:
return 0
z = 1.96 #1.96 = 95%
phat = float(ups) / n
➜ sample imagedups . --search -f 92bc12786d430083be1e166a2174b4888ba0b4ba.jpg
92bc12786d430083be1e166a2174b4888ba0b4ba.jpg
Traceback (most recent call last):
File "/usr/local/bin/imagedups", line 228, in <module>
prog.main()
File "/usr/local/bin/imagedups", line 60, in main
self.cmd_search()
File "/usr/local/bin/imagedups", line 90, in cmd_search
self.compare_with_db(hashdb, self.args.samplefile)
File "/usr/local/bin/imagedups", line 193, in compare_with_db