FacePass / database /utils.py
909ahmed's picture
fafdasdf
be9fb11
raw
history blame contribute delete
188 Bytes
import numpy as np
def similarity(v1:np.ndarray, v2:np.ndarray):
num = (v1 @ v2.T).item()
denom = np.linalg.norm(v1) * np.linalg.norm(v2)
print(num/denom)
return num/denom