hasnanmr commited on
Commit
9d91d02
1 Parent(s): 9eff9e4

fixing preprocesing

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,10 +20,10 @@ facenet.eval() # Set the model to evaluation mode
20
  val_test_transform = transforms.Compose([
21
  transforms.Resize((160, 160)), # FaceNet expects 160x160 input
22
  transforms.ToTensor(),
23
- transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])
24
  ])
25
 
26
- def compare_faces(embedding1, embedding2, threshold=0.5): # Adjusted threshold
27
  dist = np.linalg.norm(embedding1 - embedding2)
28
  return dist, dist < threshold
29
 
 
20
  val_test_transform = transforms.Compose([
21
  transforms.Resize((160, 160)), # FaceNet expects 160x160 input
22
  transforms.ToTensor(),
23
+ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
24
  ])
25
 
26
+ def compare_faces(embedding1, embedding2, threshold=0.2): # Adjusted threshold
27
  dist = np.linalg.norm(embedding1 - embedding2)
28
  return dist, dist < threshold
29