File size: 2,094 Bytes
b341afc
 
 
 
 
 
 
 
 
432aaa6
ea50d19
 
 
b341afc
 
ea50d19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
title: FaceRecognity
emoji: 🐢
colorFrom: pink
colorTo: green
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
python_version: "3.10"
short_description: Facial recognition with InsightFace using Gradio
tags: ["computer-vision", "facial-recognition", "insightface", "gradio"]
fullWidth: true
---

# FaceRecognity 🐢

FaceRecognity is a **facial recognition web app** built with **InsightFace** and **Gradio**, designed to run smoothly on Hugging Face Spaces.  
It allows you to:

- **Extract face embeddings** from any uploaded image.
- **Compare a target face** against multiple candidate images.
- Get **match confidence scores** for similarity.

---

## Features

1. **Extract Embeddings**
   - Upload an image and get a numerical face embedding vector.
   - Useful for storing face representations or running offline comparisons.

2. **Match Faces**
   - Upload a target face image and multiple candidate images.
   - Quickly identify which candidates match the target face.
   - Returns similarity scores (0–100%).

---

## How to Use

1. **Extract Embedding**
   - Go to the "Extract Embedding" tab.
   - Upload an image with a clear face.
   - Click **Extract** to get the embedding.

2. **Match Faces**
   - Go to the "Match Faces" tab.
   - Upload a target image and up to 5 candidate images.
   - Click **Match** to see which candidates match the target.

---

## Requirements

This Space uses the following Python packages:

- `gradio`
- `numpy`
- `opencv-python-headless`
- `insightface`
- `torch`
- `onnxruntime`
- `tensorflow-cpu`

> The `requirements.txt` is already included in the repository for automatic installation.

---

## Notes

- Works best with **single-face images** for extraction and matching.
- Candidate images without a detected face are ignored.
- Runs entirely in-memory—no images are stored on the server.

---

## References

- [InsightFace GitHub](https://github.com/deepinsight/insightface)
- [Gradio Docs](https://gradio.app)
- [Hugging Face Spaces Configuration Reference](https://huggingface.co/docs/hub/spaces-config-reference)