Put image score breakdown under `additional' field in search response

- Update web, emacs interfaces to consume the scores from new schema
This commit is contained in:
Debanjum Singh Solanky
2022-09-15 13:44:00 +03:00
parent e42a38e825
commit 0521ea10d6
3 changed files with 14 additions and 9 deletions

View File

@@ -220,12 +220,17 @@ def collate_results(hits, image_names, output_directory, image_files_url, count=
shutil.copy(source_path, target_path)
# Add the image metadata to the results
results += [{
"entry": f'{image_files_url}/{target_image_name}',
"score": f"{hit['score']:.9f}",
"image_score": f"{hit['image_score']:.9f}",
"metadata_score": f"{hit['metadata_score']:.9f}",
}]
results += [
{
"entry": f'{image_files_url}/{target_image_name}',
"score": f"{hit['score']:.9f}",
"additional":
{
"image_score": f"{hit['image_score']:.9f}",
"metadata_score": f"{hit['metadata_score']:.9f}",
}
}
]
return results