remove similarity constraint
Browse files
app.py
CHANGED
|
@@ -705,7 +705,7 @@ async def attention_heatmap(file: UploadFile = File(...)):
|
|
| 705 |
max_idx = int(np.argmax(sim_scores))
|
| 706 |
best_sim = float(sim_scores[max_idx])
|
| 707 |
best_rec = same_label[max_idx]
|
| 708 |
-
if best_sim <
|
| 709 |
most_similar_id = best_rec.get("source")
|
| 710 |
most_similar_score = best_sim
|
| 711 |
most_similar_img = best_rec.get("image_base64")
|
|
|
|
| 705 |
max_idx = int(np.argmax(sim_scores))
|
| 706 |
best_sim = float(sim_scores[max_idx])
|
| 707 |
best_rec = same_label[max_idx]
|
| 708 |
+
if best_sim < 2: # 排除完全相同
|
| 709 |
most_similar_id = best_rec.get("source")
|
| 710 |
most_similar_score = best_sim
|
| 711 |
most_similar_img = best_rec.get("image_base64")
|