alseambusher

facenet4

Jan 11th, 2018
14,545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. # embeddings of the generated image
  2. f_new_img = FRmodel.predict_on_batch(np.array([new_img]))
  3. # embeddings of target image
  4. f_kian = img_to_encoding("images/kian.jpg", FRmodel)
  5. # embeddings of attacker image
  6. f_attacker = FRmodel.predict_on_batch(np.array([attacker]))
  7.  
  8. # compute l2 distances
  9. print(np.linalg.norm(f_kian - f_new_img)) # 0.485102
  10. print(np.linalg.norm(f_kian - f_attacker)) # 0.862257
  11. print(np.linalg.norm(f_attacker - f_new_img)) # 0.661044
Add Comment
Please, Sign In to add comment