Sudipta Nayak commited on
Commit
141091a
·
1 Parent(s): 3aabb36

convert to numpy

Browse files
app/Hackathon_setup/face_recognition.py CHANGED
@@ -94,7 +94,7 @@ def get_similarity(img1, img2):
94
  # YOUR CODE HERE, return similarity measure using your model
95
  output1,output2 = feature_net(face1.to(device),face2.to(device))
96
  euclidean_distance = F.pairwise_distance(output1, output2)
97
- return euclidean_distance
98
 
99
  #1) Image captured from mobile is passed as parameter to this function in the API call, It returns the face class in the string form ex: "Person1"
100
  #2) The image is passed to the function in base64 encoding, Code to decode the image provided within the function
 
94
  # YOUR CODE HERE, return similarity measure using your model
95
  output1,output2 = feature_net(face1.to(device),face2.to(device))
96
  euclidean_distance = F.pairwise_distance(output1, output2)
97
+ return euclidean_distance.detach().numpy()
98
 
99
  #1) Image captured from mobile is passed as parameter to this function in the API call, It returns the face class in the string form ex: "Person1"
100
  #2) The image is passed to the function in base64 encoding, Code to decode the image provided within the function