mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +00:00
Update README.md
This commit is contained in:
parent
e63c33c20d
commit
5aec692632
@ -384,12 +384,12 @@ from lightphe import LightPHE
|
|||||||
# build an additively homomorphic cryptosystem (e.g. Paillier) on-prem
|
# build an additively homomorphic cryptosystem (e.g. Paillier) on-prem
|
||||||
cs = LightPHE(algorithm_name = "Paillier", precision = 19)
|
cs = LightPHE(algorithm_name = "Paillier", precision = 19)
|
||||||
|
|
||||||
# define a plain vector for source
|
|
||||||
alpha = DeepFace.represent("img1.jpg")[0]["embedding"] # user tower
|
|
||||||
|
|
||||||
# export keys
|
# export keys
|
||||||
cs.export_keys("secret.txt"); cs.export_keys("public.txt", public=True)
|
cs.export_keys("secret.txt"); cs.export_keys("public.txt", public=True)
|
||||||
|
|
||||||
|
# define a plain vector for source
|
||||||
|
alpha = DeepFace.represent("img1.jpg")[0]["embedding"] # user tower
|
||||||
|
|
||||||
# encrypt source embedding
|
# encrypt source embedding
|
||||||
encrypted_alpha = cs.encrypt(alpha)
|
encrypted_alpha = cs.encrypt(alpha)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user