Update README.md
Browse files
README.md
CHANGED
@@ -1,107 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
```bash
|
12 |
-
https://face-recognition-tf-1.onrender.com
|
13 |
-
```
|
14 |
-
Note : Loading may take some time due to limited server processing capability.
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
## Outputs
|
19 |
-
<img width="956" alt="356581473-3f98e226-d9a5-4036-9c35-06481f292c8a" src="https://github.com/user-attachments/assets/60c7ea7f-1604-421b-8265-5b171da0edaa">
|
20 |
-
<img width="956" alt="image" src="https://github.com/user-attachments/assets/1bc6a9c0-2698-483c-b478-80bf8d29f442">
|
21 |
-
|
22 |
-
|
23 |
-
## Key Features
|
24 |
-
|
25 |
-
__1)__ __Face detection using MTCNN__ :
|
26 |
-
Used MTCNN for accurate face detection on images.
|
27 |
-
|
28 |
-
__2)__ __Embedding extraction using FacNet__ :
|
29 |
-
created embeddings vectors of shape (512,1) using a Tensorflow pretrained model on face datasets.
|
30 |
-
|
31 |
-
__3)__ __Pinecone Database for efficent storage and retreival__:
|
32 |
-
Created a pinecone DB index for storing embdeeings by creating relevent metadata and upserting it to the index with cosine similarity as serach parameter.
|
33 |
-
|
34 |
-
__4)__ __Siamease Network Architehture__:
|
35 |
-
Implemented a Siamease Network like architehture to acheive one shot learning for face recognition using a combination of face detection and face recognition.
|
36 |
-
|
37 |
-
__5)__ __Streamlit application__:
|
38 |
-
Created and deployed an interactive streamlit application to interact with the project. Deployment was done on render.
|
39 |
-
|
40 |
-
__6)__ __Multiface Detection capabilities__:
|
41 |
-
The model is able to detect and recognise multiple faces in an image however for creating a new entry in the database for a person, an induidual image is required to ensure integrity of the data in the database.
|
42 |
-
|
43 |
-
__7)__ __Modularity of code__:
|
44 |
-
The project is cretated so that the induvidual blocks can be changed to suit the detection needs, eg. MTCNN can be replace with YOLO detection for faster results for applications such as ANPR after replacing FaceNet with a suitably trained model to generate embeddings.
|
45 |
-
|
46 |
-
|
47 |
-
## Pinecone API Reference
|
48 |
-
|
49 |
-
##### Refer to Pinecone Documentation at : [pc docs](https://docs.pinecone.io/reference/api/introduction)
|
50 |
-
|
51 |
-
#### Pinecone env variables used :
|
52 |
-
|
53 |
-
| Parameter | Type | Description |
|
54 |
-
| :-------- | :------- | :------------------------- |
|
55 |
-
| `Pinecone key` | `string` | <Your API key>|
|
56 |
-
| `Pinecone index` | `string` | Name of Index |
|
57 |
-
|
58 |
-
|
59 |
-
#### Installing pinecone client
|
60 |
-
```bash
|
61 |
-
pip install pinecone --upgrade pinecone-client
|
62 |
-
```
|
63 |
-
#### Connecting to index and upserting
|
64 |
-
|
65 |
-
```bash
|
66 |
-
from pinecone import Pinecone
|
67 |
-
pc = Pinecone(os.environ["PINECONE_API_KEY"])
|
68 |
-
index = pc.Index(os.environ["PINECONE_IDX"])
|
69 |
-
```
|
70 |
-
```bash
|
71 |
-
vectors = 'Create Vectors'
|
72 |
-
index.upsert(vectors)
|
73 |
-
```
|
74 |
-
|
75 |
-
#### Query top k vectors
|
76 |
-
```bash
|
77 |
-
out = index.query(
|
78 |
-
vector = vectors.tolist(),
|
79 |
-
top_k = k,
|
80 |
-
include_metadata = True
|
81 |
-
)
|
82 |
-
```
|
83 |
-
|
84 |
-
|
85 |
-
## Dependencies
|
86 |
-
- OpenCV
|
87 |
-
- Tensorflow
|
88 |
-
- MTCNN
|
89 |
-
- FaceNet
|
90 |
-
- Pinecone
|
91 |
-
- streamlit
|
92 |
-
- os
|
93 |
-
- dotenv
|
94 |
-
- numpy
|
95 |
-
#### Installation :
|
96 |
-
After pulling this repo, run:
|
97 |
-
```bash
|
98 |
-
pip install requirements
|
99 |
-
```
|
100 |
-
#### env file setup :
|
101 |
-
setup an env file to store api keys and index information as the template :
|
102 |
-
```bash
|
103 |
-
pinecone_key = "your_api_key"
|
104 |
-
pinecone_index = "your_index_name"
|
105 |
-
```
|
106 |
-
|
107 |
-
|
|
|
1 |
+
---
|
2 |
+
title: Streamlit App
|
3 |
+
emoji: 🚀
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: purple
|
6 |
+
sdk: streamlit
|
7 |
+
sdk_version: "1.26.0"
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|