Commit ·
fc9e21c
1
Parent(s): 727909c
siamese network first push
Browse files
app/Hackathon_setup/face_recognition.py
CHANGED
|
@@ -5,6 +5,7 @@ import torch
|
|
| 5 |
import torch.nn.functional as F
|
| 6 |
# In the below line,remove '.' while working on your local system. However Make sure that '.' is present before face_recognition_model while uploading to the server, Do not remove it.
|
| 7 |
from .face_recognition_model import *
|
|
|
|
| 8 |
from PIL import Image
|
| 9 |
import base64
|
| 10 |
import io
|
|
@@ -74,7 +75,7 @@ def get_similarity(img1, img2):
|
|
| 74 |
##########################################################################################
|
| 75 |
|
| 76 |
# YOUR CODE HERE, load the model
|
| 77 |
-
myModel =
|
| 78 |
ckpt = torch.load('./siamese_model.t7')
|
| 79 |
myModel.load_state_dict(ckpt['net_dict'])
|
| 80 |
myModel.eval()
|
|
|
|
| 5 |
import torch.nn.functional as F
|
| 6 |
# In the below line,remove '.' while working on your local system. However Make sure that '.' is present before face_recognition_model while uploading to the server, Do not remove it.
|
| 7 |
from .face_recognition_model import *
|
| 8 |
+
from .face_recognition_model import Siamese
|
| 9 |
from PIL import Image
|
| 10 |
import base64
|
| 11 |
import io
|
|
|
|
| 75 |
##########################################################################################
|
| 76 |
|
| 77 |
# YOUR CODE HERE, load the model
|
| 78 |
+
myModel = Siamese().cuda()
|
| 79 |
ckpt = torch.load('./siamese_model.t7')
|
| 80 |
myModel.load_state_dict(ckpt['net_dict'])
|
| 81 |
myModel.eval()
|