mirror of
https://github.com/simon987/fastimagehash.git
synced 2025-12-16 23:59:02 +00:00
Initial commit (squashed)
This commit is contained in:
37
bench/run.py
Normal file
37
bench/run.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from subprocess import check_output, DEVNULL
|
||||
import csv
|
||||
|
||||
files = (
|
||||
"100px",
|
||||
"200px",
|
||||
"300px",
|
||||
"500px",
|
||||
"1000px",
|
||||
"2000px",
|
||||
"3000px",
|
||||
"4000px",
|
||||
"6000px",
|
||||
"8000px",
|
||||
)
|
||||
|
||||
for f in files:
|
||||
out = check_output(["python", "benchmark.py", f])
|
||||
print(out.decode(), end="")
|
||||
|
||||
print()
|
||||
|
||||
for f in files:
|
||||
out = check_output(["./bm", f, "--benchmark_format=csv"], stderr=DEVNULL)
|
||||
|
||||
for line in out.decode().splitlines(keepends=False):
|
||||
if line.startswith("\"BM_"):
|
||||
m, _, t, *_ = line.split(",")
|
||||
if "phash" in m:
|
||||
method = "phash"
|
||||
if "dhash" in m:
|
||||
method = "dhash"
|
||||
if "ahash" in m:
|
||||
method = "ahash"
|
||||
if "whash" in m:
|
||||
method = "whash"
|
||||
print("%s_%s,%s" % (f, method, t))
|
||||
Reference in New Issue
Block a user