mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
formatted
This commit is contained in:
parent
a79b49f26b
commit
42a8606198
@ -88,7 +88,7 @@ DeepFace.verify("img1.jpg", "img2.jpg", model_name = "VGG-Face", model = model)
|
||||
|
||||
**Similarity**
|
||||
|
||||
Face recognition models are regular [`convolutional neural networks`](https://sefiks.com/2018/03/23/convolutional-autoencoder-clustering-images-with-neural-networks/) and they are responsible to represent face photos as vectors. Decision of verification is based on the distance between vectors. We can classify pairs if its distance is less than a [`threshold`](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). Distance could be found by different metrics such as [`Cosine Similarity`](https://sefiks.com/2018/08/13/cosine-similarity-in-machine-learning/), Euclidean Distance and L2 form. The default configuration finds the **cosine similarity**. You can alternatively set the similarity metric while verification as demostratred below.
|
||||
Face recognition models are regular [convolutional neural networks](https://sefiks.com/2018/03/23/convolutional-autoencoder-clustering-images-with-neural-networks/) and they are responsible to represent face photos as vectors. Decision of verification is based on the distance between vectors. We can classify pairs if its distance is less than a [threshold](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). Distance could be found by different metrics such as [Cosine Similarity](https://sefiks.com/2018/08/13/cosine-similarity-in-machine-learning/), Euclidean Distance and L2 form. The default configuration finds the **cosine similarity**. You can alternatively set the similarity metric while verification as demostratred below.
|
||||
|
||||
```python
|
||||
result = DeepFace.verify("img1.jpg", "img2.jpg", model_name = "VGG-Face", distance_metric = "cosine")
|
||||
|
Loading…
x
Reference in New Issue
Block a user