Any Face Clustering:
Automatically Group your Images by Faces with an
end-to-end Artificial Intelligence App
                  Â
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.
- Usage / User Interaction with the Project (follow any one)
- Demo video of the Streamlit Web App
- Motivation and Use Cases
- Detailed Project Code with Explanation
- Citing
- Dependencies
- Acknowledgement
💡 To launch the "Any Face Clustering" Streamlit Web App...
-
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.
- 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
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
-
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.
- 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.
@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}}
}
- OpenCV (cv2)
- Face-Recognition
- scikit-learn
- Numpy
- Streamlit
- imutils
- os
- time
- shutil
- tempfile
- https://opencv.org/
- https://face-recognition.readthedocs.io/en/latest/index.html
- https://scikit-learn.org/stable/
- https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html
- https://numpy.org/
- https://streamlit.io/
- https://pypi.org/project/imutils/
- https://docs.python.org/3/library/os.html
- https://docs.python.org/3/library/time.html
- https://docs.python.org/3/library/shutil.html
- https://docs.python.org/3/library/tempfile.html
- https://pyimagesearch.com/2018/07/09/face-clustering-with-python/