Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -232,6 +232,7 @@ def prod_function(app, prod_path, webcam_path):
|
|
232 |
face_embedding = torch.from_numpy(np.array(face_embedding))
|
233 |
|
234 |
similarity_score.append(F.cosine_similarity(face_embedding,webcam_emb, dim=0))
|
|
|
235 |
#distance = F.pairwise_distance(emb, emb_prod)
|
236 |
#prod_preds.append(distance)
|
237 |
|
@@ -285,7 +286,7 @@ with app_tab:
|
|
285 |
with st.spinner("Wait for it...", show_time=True):
|
286 |
# Run the predictions
|
287 |
prediction = prod_function(app, image_paths, picture)
|
288 |
-
prediction = torch.cat(prediction, 0).to(device)
|
289 |
match_idx = torch.argmax(prediction)
|
290 |
st.write(prediction)
|
291 |
st.write(image_paths)
|
|
|
232 |
face_embedding = torch.from_numpy(np.array(face_embedding))
|
233 |
|
234 |
similarity_score.append(F.cosine_similarity(face_embedding,webcam_emb, dim=0))
|
235 |
+
similarity_score = torch.from_numpy(np.array(similarity_score))
|
236 |
#distance = F.pairwise_distance(emb, emb_prod)
|
237 |
#prod_preds.append(distance)
|
238 |
|
|
|
286 |
with st.spinner("Wait for it...", show_time=True):
|
287 |
# Run the predictions
|
288 |
prediction = prod_function(app, image_paths, picture)
|
289 |
+
#prediction = torch.cat(prediction, 0).to(device)
|
290 |
match_idx = torch.argmax(prediction)
|
291 |
st.write(prediction)
|
292 |
st.write(image_paths)
|