Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ model = SentenceTransformer("sentence-transformers/clip-ViT-L-14")
|
|
7 |
|
8 |
def predict(im1, im2):
|
9 |
embeddings = model.encode([im1, im2])
|
10 |
-
sim = cosine_similarity(embeddings[0][None,:], embeddings[
|
11 |
# ANSWER HERE
|
12 |
if sim > 0.78:
|
13 |
return sim, "SAME PERSON, UNLOCK PHONE"
|
|
|
7 |
|
8 |
def predict(im1, im2):
|
9 |
embeddings = model.encode([im1, im2])
|
10 |
+
sim = cosine_similarity(embeddings[0][None,:], embeddings[1][None,:])[0][0]
|
11 |
# ANSWER HERE
|
12 |
if sim > 0.78:
|
13 |
return sim, "SAME PERSON, UNLOCK PHONE"
|