In this repository, I've experimented with face recognition by clustering image embeddings. The image embeddings are generated using Retina-Face and reduced to a 2 or 3 dimensional representation using UMAP dimensionality reduction algorithm. Later the vectors are labelled into clusters using DBSCAN and HDBSCAN algorithms.
.
├── clean.py
├── embed.py
├── faces
│ ├── face1
│ └── face2
├── faces.py
├── flow.sh
├── imgs
│ ├── face1
│ └── face2
├── other-methods
│ ├── faces-mtcnn.py
│ ├── faces-nudenet.py
│ └── faces-retina.py
├── README.md
├── requirements.txt
└── viz.py
- Clone the repo.
- Run
pip install -r requirements.txt
. - Download the face dataset you like to use and set it according to the directory structure.
- Run the python files in this order (Or just run
flow.sh
):
python3 clean.py
python3 faces.py
python3 embed.py
- MTCNN doesn't give much good results
- NudeNet is good but wastes compute on detecting other things
- retina-face is by far the best. Just uses a lot of resources. (Works good on Google Colab but, not recommended for local machine)
- Facenet works just right