Skip to content

📸 Face Clustering Engine developed using OpenCV & DBSCAN, deployed as a Streamlit Web App to deliver uploaded images grouped according to the individual unique faces in them.

License

Notifications You must be signed in to change notification settings

souvikmajumder26/Any-Face-Clustering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Any Face Clustering:
Automatically Group your Images by Faces with an
end-to-end Artificial Intelligence App

                    Jupyter Python Dependencies GitHub Issues Contributions welcome License


Overview

A Face Clustering Engine has been developed utilizing OpenCV, Face Recognition & DBSCAN (scikit-learn) python libraries. The project has been deployed as a Streamlit Web App which provides users the facility to upload their own images (or images they want to test with) and be delivered with the images grouped according to the individual unique faces contained in them.

A Face Clustering Engine in essence performs grouping of user-provided images according to the unique faces contained in them. Unsupervised Learning being at the core of this Face Clustering Engine enables it to cluster/group images by faces which it hasn't even seen (trained on) yet. Thus it is applicable to Any Face.


Table of Contents

  1. Usage / User Interaction with the Project (follow any one)
  2. Demo video of the Streamlit Web App
  3. Motivation and Use Cases
  4. Detailed Project Code with Explanation
  5. Citing
  6. Dependencies
  7. Acknowledgement

1. Usage / User Interaction with the Project (follow any one)

💡 To launch the "Any Face Clustering" Streamlit Web App...

a) Follow these steps to open the Project in Google Colab Notebook:

  • Open the file "Any_Face_Clustering_Streamlit_app.ipnyb" and click "Open in Colab" OR just click here :D

    💡 A notebook will open in Google Colab.

    💡 This app can be deployed directly on cloud for end-users, but as it requires a lot of memory (RAM) for its computation, it could not be deployed successfully to a free-tier cloud service (eg: Streamlit Share Cloud, Heroku, AWS, Azure, GCP etc.), thus Google Colab was chosen to work as the free server for this project prototype.

  • Follow the next steps mentioned inside the notebook to launch the Streamlit Web App.

b) Follow these steps to open the Project Locally:

  • Download/clone the repository onto desktop
  • setup.cfg, setup.py run python setup.py
  • Launch the Streamlit Web App by opening the file "app.py" - streamlit run myfile.py

2. [Demo] Follow this video on how to interact with the Streamlit App after launching it:

Feel free to interact with the Streamlit Web App...

💡 Upload images of several faces (make sure to upload atleast 3 images containing the same face)... or you can choose to use the Unlabelled_test_images by downloading the folder and then uploading the images to the Web App to experience how the project works.

Any-Face-Clustering-Streamlit-WebApp-Demo.mp4

3. Motivation and Use Cases

  • Long before I knew anything about Artificial Intelligence, I discovered a feature in my mobile phone which grouped all images according to the faces contained in them. I was always intruiged by this feature and wondered how this had been achieved. After a few years, fortunately I was exposed to the field of Data Science and Artificial Intelligence, and now I have been able to fulfill my old curiosity by building the same feature in the form of a Web App prototype to be used by anyone.

  • Other than Web & Mobile application integrations of this project making lives easier by enabling people to search photos by a particular face, another crucial use case of this project can be Law Enforcement. In case of a crime scene, suppose there are active security cameras in the neighbourhood that recorded the people present at the crime scene and in the nearby areas. So, even if the law enforcement/police officers arrive after the criminal(s) has/have fled, this can help the law enforcement in tracking the routes and activities of the people present there and in the neighbourhood areas by comparing unique faces/identities from several video feeds to check for suspicious activities which will further aid in the investigation.


4. Detailed Project Code with Explanation

  • Open the file "Detailed_Project_Explanation.ipnyb" and click "Open in Colab" OR just click here to open the notebook with detailed and explained project code.

5. Citing

@misc{Souvik2022,
  Author = {Souvik Majumder},
  Title = {Any Face Clustering},
  Year = {2022},
  Publisher = {GitHub},
  Journal = {GitHub repository},
  Howpublished = {\url{https://github.com/souvikmajumder26/Any-Face-Clustering}}
}

6. Dependencies

  • OpenCV (cv2)
  • Face-Recognition
  • scikit-learn
  • Numpy
  • Streamlit
  • imutils
  • os
  • time
  • shutil
  • tempfile

7. Acknowledgement