Skip to content

Facial recognition using clustering algorithms.

Notifications You must be signed in to change notification settings

mdhvg/face-clusters

Repository files navigation

Face Clusters

Open Notebook In Colab

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.

Clustered image embeddings shown in different colors

Project structure

.
├── 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

Usage

  • 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

Conclusions

Face Extraction

  • 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)

Face recognition

  • Facenet works just right

About

Facial recognition using clustering algorithms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published