Update build

This commit is contained in:
2023-06-11 07:53:00 -04:00
parent 8e025a6416
commit 54f7fc5613
4 changed files with 311 additions and 230 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import timeit
import sys
@@ -6,9 +6,11 @@ IMAGE = sys.argv[1]
COUNT = 20
SIZE = 8
def print_result(method, time):
print("%s_%s,%d" % (IMAGE, method, time / COUNT * 1000000000))
print_result("phash", timeit.timeit(
setup="from imagehash import phash \n"
"from PIL import Image",
@@ -36,4 +38,3 @@ print_result("ahash", timeit.timeit(
stmt="average_hash(Image.open('%s'), hash_size=%d)" % (IMAGE, SIZE),
number=COUNT
))

View File

@@ -15,7 +15,7 @@ files = (
)
for f in files:
out = check_output(["python", "benchmark.py", f])
out = check_output(["python3", "benchmark.py", f])
print(out.decode(), end="")
print()