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 annoy import AnnoyIndex | |
index = AnnoyIndex(1) | |
for x in range(10000): | |
id = "%d000%d" % (x,x) | |
index.add_item(int(id),[x]) |
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
48000693 | |
49000693 | |
50000693 | |
51000693 | |
52000693 | |
53000693 | |
54000693 | |
55000693 | |
56000693 | |
57000693 |
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 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 |
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
➜ 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 |
NewerOlder