mirror of
https://github.com/simon987/fastimagehash.git
synced 2025-12-10 21:18:50 +00:00
Add multi_hash (wip/untested)
This commit is contained in:
@@ -29,3 +29,7 @@ fastimagehash v0.1
|
||||
**ahash**
|
||||

|
||||

|
||||
|
||||
**multi_hash**
|
||||

|
||||

|
||||
|
||||
@@ -36,3 +36,16 @@ print_result("ahash", timeit.timeit(
|
||||
stmt="average_hash(Image.open('%s'), hash_size=%d)" % (IMAGE, SIZE),
|
||||
number=COUNT
|
||||
))
|
||||
|
||||
print_result("multi", timeit.timeit(
|
||||
setup="from imagehash import average_hash,phash,whash,dhash \n"
|
||||
"from PIL import Image",
|
||||
stmt="im = Image.open('%s');"
|
||||
"size = %d;"
|
||||
"average_hash(im.copy(), hash_size=size);"
|
||||
"phash(im.copy(), hash_size=size);"
|
||||
"whash(im.copy(), hash_size=size, remove_max_haar_ll=False);"
|
||||
"dhash(im.copy(), hash_size=size);"
|
||||
% (IMAGE, SIZE),
|
||||
number=COUNT
|
||||
))
|
||||
|
||||
BIN
bench/results/multi_large.png
Normal file
BIN
bench/results/multi_large.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
bench/results/multi_small.png
Normal file
BIN
bench/results/multi_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -34,4 +34,6 @@ for f in files:
|
||||
method = "ahash"
|
||||
if "whash" in m:
|
||||
method = "whash"
|
||||
if "multi" in m:
|
||||
method = "multi"
|
||||
print("%s_%s,%s" % (f, method, t))
|
||||
|
||||
Reference in New Issue
Block a user