Spaces:
Runtime error
Runtime error
Fix pydantic error
Browse files
app.py
CHANGED
@@ -70,9 +70,9 @@ def predict(image, det_choice, emb_choice):
|
|
70 |
elif emb_choice == 'vae-encoder':
|
71 |
for box in boxes:
|
72 |
cropped_stamp = to_tensor(image.crop(box.tolist()).resize((118, 118)))
|
73 |
-
embeddings.append(encoder(cropped_stamp.unsqueeze(0).to(device))[0][0].detach().cpu())
|
74 |
|
75 |
-
embeddings = np.stack(
|
76 |
|
77 |
similarities = cosine_similarity(embeddings)
|
78 |
|
|
|
70 |
elif emb_choice == 'vae-encoder':
|
71 |
for box in boxes:
|
72 |
cropped_stamp = to_tensor(image.crop(box.tolist()).resize((118, 118)))
|
73 |
+
embeddings.append(np.array(encoder(cropped_stamp.unsqueeze(0).to(device))[0][0].detach().cpu()))
|
74 |
|
75 |
+
embeddings = np.stack(embeddings)
|
76 |
|
77 |
similarities = cosine_similarity(embeddings)
|
78 |
|