dvieri commited on
Commit
da417db
·
verified ·
1 Parent(s): 0b69dc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 pickle
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 = pickle.load(f)
84
  with open('./pca.pkl', 'rb') as f:
85
- pca = pickle.load(f)
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)