mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 05:39:11 +00:00
Use of XMP metadata in Khoj Image Search is broken. Disable by default
- CLIP Image score and XMP metadata score are not combining well.
When combined they give non sensical results. Enable only once
figure how best to combine the two.
- Show scores with higher precision for image search
- Image search scores seem to be mostly be between 0.2 - 0.3 for some reason
- Higher precision scores make it easier to understand the quality
of returned results perceived by the model itself
This commit is contained in:
@@ -22,7 +22,7 @@ content-type:
|
||||
input-filter: # /path/to/images/*.jpg REQUIRED IF input-directories IS NOT SET
|
||||
embeddings-file: "~/.khoj/content/image/image_embeddings.pt"
|
||||
batch-size: 50
|
||||
use-xmp-metadata: true
|
||||
use-xmp-metadata: false
|
||||
|
||||
music:
|
||||
input-files: # ["/path/to/music-file.org"] REQUIRED IF input-filter IS NOT SET OR
|
||||
|
||||
@@ -211,9 +211,9 @@ def collate_results(hits, image_names, output_directory, image_files_url, count=
|
||||
# Add the image metadata to the results
|
||||
results += [{
|
||||
"entry": f'{image_files_url}/{target_image_name}',
|
||||
"score": f"{hit['score']:.3f}",
|
||||
"image_score": f"{hit['image_score']:.3f}",
|
||||
"metadata_score": f"{hit['metadata_score']:.3f}",
|
||||
"score": f"{hit['score']:.9f}",
|
||||
"image_score": f"{hit['image_score']:.9f}",
|
||||
"metadata_score": f"{hit['metadata_score']:.9f}",
|
||||
}]
|
||||
|
||||
return results
|
||||
|
||||
@@ -30,7 +30,7 @@ default_config = {
|
||||
'input-filter': None,
|
||||
'embeddings-file': '~/.khoj/content/image/image_embeddings.pt',
|
||||
'batch-size': 50,
|
||||
'use-xmp-metadata': True
|
||||
'use-xmp-metadata': False
|
||||
},
|
||||
'music': {
|
||||
'input-files': None,
|
||||
|
||||
Reference in New Issue
Block a user