Spaces:
Runtime error
Runtime error
Add requirements
Browse files
app.py
CHANGED
@@ -92,8 +92,8 @@ def main():
|
|
92 |
st.title("CLIP Image Search")
|
93 |
model = load_model("clip-ViT-B-32")
|
94 |
st.write("Select the mode to search for a match in Unsplash (thumbnail size) dataset. text2image mode needs a text as input and outputs the image with the most similar embedding (following cosine similarity). The Image to image mode is similar, but an input image is used instead of a text query")
|
95 |
-
emb_filename = Path("
|
96 |
-
urls_file = "
|
97 |
img_urls = load_image_url_list(urls_file)
|
98 |
img_names, img_emb = load_embeddings(emb_filename)
|
99 |
# Convert list of image names to a dict matching image IDs and their embedding index
|
|
|
92 |
st.title("CLIP Image Search")
|
93 |
model = load_model("clip-ViT-B-32")
|
94 |
st.write("Select the mode to search for a match in Unsplash (thumbnail size) dataset. text2image mode needs a text as input and outputs the image with the most similar embedding (following cosine similarity). The Image to image mode is similar, but an input image is used instead of a text query")
|
95 |
+
emb_filename = Path("unsplash-25k-photos-embeddings.pkl")
|
96 |
+
urls_file = "photos.tsv000"
|
97 |
img_urls = load_image_url_list(urls_file)
|
98 |
img_names, img_emb = load_embeddings(emb_filename)
|
99 |
# Convert list of image names to a dict matching image IDs and their embedding index
|