ritts97 / Unsupervised-Face-Clustering

Unsupervised face clustering using Dlib Chinese Whispers algorithm
MIT License
11 stars 2 forks source link

An alternate solution available? #2

Closed samcode22 closed 4 years ago

samcode22 commented 4 years ago

Here,the faces are cropped from the image and then are clustered and shown in different folders with a very good accuracy. Is there any option by which whole image is shown in folder instead of only face? For example, if Sachin and Sourav are in a pic then the whole pic to be shown in 2 folders(sachin's as well as sourav)

In your code Save_face_chip function hinders this..So can You suggest a solution for it. Thanks!!!

ritts97 commented 4 years ago

Hi Samyak! Sorry for the late reply I never noticed an issue was opened here. Yes, you can get the results you want by making the following changes: In the file face_clustering.py

Replace line no. 65 with - file_path = os.path.join(output_folderpath,"face"+str(k)+"_"+str(i)+".jpg")

Replace line no. 66 with- dlib.save_image(img, file_path)

Basically, instead of using save_face_chip() we can use save_image() to save the whole image.

Hope this helps!