Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import torch
|
|
5 |
from torchvision import transforms
|
6 |
from mtcnn import MTCNN
|
7 |
from skimage.feature import hog
|
8 |
-
import
|
9 |
import torch.nn as nn
|
10 |
from torchvision.models import resnet50
|
11 |
|
@@ -80,9 +80,9 @@ def verify(img1, img2, model_type):
|
|
80 |
|
81 |
if model_type == "HOG-SVM":
|
82 |
with open('./svm.pkl', 'rb') as f:
|
83 |
-
svm =
|
84 |
with open('./pca.pkl', 'rb') as f:
|
85 |
-
pca =
|
86 |
|
87 |
face1 = preprocess_image_svm(face1)
|
88 |
face2 = preprocess_image_svm(face2)
|
|
|
5 |
from torchvision import transforms
|
6 |
from mtcnn import MTCNN
|
7 |
from skimage.feature import hog
|
8 |
+
import joblib
|
9 |
import torch.nn as nn
|
10 |
from torchvision.models import resnet50
|
11 |
|
|
|
80 |
|
81 |
if model_type == "HOG-SVM":
|
82 |
with open('./svm.pkl', 'rb') as f:
|
83 |
+
svm = joblib.load(f)
|
84 |
with open('./pca.pkl', 'rb') as f:
|
85 |
+
pca = joblib.load(f)
|
86 |
|
87 |
face1 = preprocess_image_svm(face1)
|
88 |
face2 = preprocess_image_svm(face2)
|