Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # embeddings of the generated image
- f_new_img = FRmodel.predict_on_batch(np.array([new_img]))
- # embeddings of target image
- f_kian = img_to_encoding("images/kian.jpg", FRmodel)
- # embeddings of attacker image
- f_attacker = FRmodel.predict_on_batch(np.array([attacker]))
- # compute l2 distances
- print(np.linalg.norm(f_kian - f_new_img)) # 0.485102
- print(np.linalg.norm(f_kian - f_attacker)) # 0.862257
- print(np.linalg.norm(f_attacker - f_new_img)) # 0.661044
Add Comment
Please, Sign In to add comment