Spaces:
Build error
Build error
MarkusEssl
commited on
Commit
·
028ae6c
1
Parent(s):
99d0358
- pages/3_Verify.py +1 -0
pages/3_Verify.py
CHANGED
@@ -78,6 +78,7 @@ if st.session_state.predict:
|
|
78 |
weights = torch.load("pages/siamese.pth", map_location=torch.device('cpu'))["model_state_dict"]
|
79 |
model = SiameseNetwork(backbone)
|
80 |
model.load_state_dict(weights)
|
|
|
81 |
img1, img2 = transform_valid(img1).unsqueeze(0), transform_valid(img2).unsqueeze(0)
|
82 |
prediction = model(img1,img2)
|
83 |
st.write(f"The signatures match with a probability of {str(round(float(prediction)*100, 2))}%")
|
|
|
78 |
weights = torch.load("pages/siamese.pth", map_location=torch.device('cpu'))["model_state_dict"]
|
79 |
model = SiameseNetwork(backbone)
|
80 |
model.load_state_dict(weights)
|
81 |
+
model.eval()
|
82 |
img1, img2 = transform_valid(img1).unsqueeze(0), transform_valid(img2).unsqueeze(0)
|
83 |
prediction = model(img1,img2)
|
84 |
st.write(f"The signatures match with a probability of {str(round(float(prediction)*100, 2))}%")
|