sadjava commited on
Commit
6350200
1 Parent(s): 9f6776c

Fix pydantic error

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(np.array(embeddings))
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