Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,16 +93,11 @@ def verify(image, model, person):
|
|
| 93 |
siamese.eval()
|
| 94 |
|
| 95 |
face = preprocess_image_siamese(face)
|
| 96 |
-
|
| 97 |
-
# Move to device
|
| 98 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 99 |
-
model.to(device)
|
| 100 |
-
face = face.to(device)
|
| 101 |
|
| 102 |
with torch.no_grad():
|
| 103 |
output = model(face)
|
| 104 |
probability = output.item()
|
| 105 |
-
pred = 1.0 if probability > 0.
|
| 106 |
|
| 107 |
if pred == 1:
|
| 108 |
st.write("Match")
|
|
|
|
| 93 |
siamese.eval()
|
| 94 |
|
| 95 |
face = preprocess_image_siamese(face)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
with torch.no_grad():
|
| 98 |
output = model(face)
|
| 99 |
probability = output.item()
|
| 100 |
+
pred = 1.0 if probability > 0.7 else 0.0
|
| 101 |
|
| 102 |
if pred == 1:
|
| 103 |
st.write("Match")
|