consider arguments have impact on embeddings

This commit is contained in:
Sefik Ilkin Serengil 2024-04-12 17:22:08 +01:00
parent b2ed849183
commit 32f8f6596e

View File

@ -92,8 +92,22 @@ def find(
if os.path.isdir(db_path) is not True: if os.path.isdir(db_path) is not True:
raise ValueError("Passed db_path does not exist!") raise ValueError("Passed db_path does not exist!")
file_name = f"ds_{model_name}_{detector_backend}_v2.pkl" file_parts = [
"ds",
"model",
model_name,
"detector",
detector_backend,
"aligned" if align else "unaligned",
"normalization",
normalization,
"expand",
str(expand_percentage),
]
file_name = "_".join(file_parts) + ".pkl"
file_name = file_name.replace("-", "").lower() file_name = file_name.replace("-", "").lower()
datastore_path = os.path.join(db_path, file_name) datastore_path = os.path.join(db_path, file_name)
representations = [] representations = []
@ -176,6 +190,7 @@ def find(
detector_backend=detector_backend, detector_backend=detector_backend,
enforce_detection=enforce_detection, enforce_detection=enforce_detection,
align=align, align=align,
expand_percentage=expand_percentage,
normalization=normalization, normalization=normalization,
silent=silent, silent=silent,
) # add new images ) # add new images