Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -326,7 +326,7 @@ def search_similar_items(features, top_k=10):
|
|
326 |
similar_items = []
|
327 |
for metadata, distance in zip(results['metadatas'][0], results['distances'][0]):
|
328 |
try:
|
329 |
-
similarity_score =
|
330 |
item_data = metadata.copy()
|
331 |
item_data['similarity_score'] = similarity_score
|
332 |
similar_items.append(item_data)
|
@@ -361,7 +361,7 @@ def show_similar_items(similar_items):
|
|
361 |
st.image(item['image_url'], use_column_width=True)
|
362 |
|
363 |
# ์ ์ฌ๋ ์ ์๋ฅผ ํผ์ผํธ๋ก ํ์
|
364 |
-
similarity_percent = item['similarity_score']
|
365 |
st.markdown(f"**Similarity: {similarity_percent:.1f}%**")
|
366 |
|
367 |
st.write(f"Brand: {item.get('brand', 'Unknown')}")
|
|
|
326 |
similar_items = []
|
327 |
for metadata, distance in zip(results['metadatas'][0], results['distances'][0]):
|
328 |
try:
|
329 |
+
similarity_score = distance
|
330 |
item_data = metadata.copy()
|
331 |
item_data['similarity_score'] = similarity_score
|
332 |
similar_items.append(item_data)
|
|
|
361 |
st.image(item['image_url'], use_column_width=True)
|
362 |
|
363 |
# ์ ์ฌ๋ ์ ์๋ฅผ ํผ์ผํธ๋ก ํ์
|
364 |
+
similarity_percent = item['similarity_score']
|
365 |
st.markdown(f"**Similarity: {similarity_percent:.1f}%**")
|
366 |
|
367 |
st.write(f"Brand: {item.get('brand', 'Unknown')}")
|