Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
909ahmed
/
FacePass
like
0
Sleeping
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
main
FacePass
/
database
/
utils.py
909ahmed
fafdasdf
be9fb11
3 months ago
raw
Copy download link
history
blame
contribute
delete
Safe
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