Spaces:
Runtime error
Runtime error
Samuel Schmidt
commited on
Commit
·
fe476eb
1
Parent(s):
d8a45b1
Update src/app.py
Browse files- src/app.py +4 -1
src/app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from colordescriptor import ColorDescriptor
|
2 |
from CLIP import CLIPImageEncoder
|
3 |
from LBP import LBPImageEncoder
|
4 |
-
from helper import chi2_distance, euclidean_distance
|
5 |
import gradio as gr
|
6 |
import os
|
7 |
import cv2
|
@@ -28,6 +28,9 @@ def index_dataset(dataset):
|
|
28 |
clip_model = CLIPImageEncoder()
|
29 |
dataset_with_embeddings = dataset_with_embeddings.map(clip_model.encode_images, batched=True, batch_size=16)
|
30 |
|
|
|
|
|
|
|
31 |
|
32 |
# Add index
|
33 |
dataset_with_embeddings.add_faiss_index(column='color_embeddings')
|
|
|
1 |
from colordescriptor import ColorDescriptor
|
2 |
from CLIP import CLIPImageEncoder
|
3 |
from LBP import LBPImageEncoder
|
4 |
+
from helper import chi2_distance, euclidean_distance, merge_features
|
5 |
import gradio as gr
|
6 |
import os
|
7 |
import cv2
|
|
|
28 |
clip_model = CLIPImageEncoder()
|
29 |
dataset_with_embeddings = dataset_with_embeddings.map(clip_model.encode_images, batched=True, batch_size=16)
|
30 |
|
31 |
+
print("LBP and Color")
|
32 |
+
dataset_with_embeddings = dataset_with_embeddings.map(lambda row: {'lbp_color_embeddings': merge_features(row['lbp_embeddings'], row['color_embeddings']})
|
33 |
+
|
34 |
|
35 |
# Add index
|
36 |
dataset_with_embeddings.add_faiss_index(column='color_embeddings')
|