sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
952 stars 218 forks source link

Clustering faces #1475

Open hauck-jvsh opened 1 year ago

hauck-jvsh commented 1 year ago

In order to improve #1472, an clustering algorithm should be used. I'm planing to implement a simple one, as the one presented here https://pyimagesearch.com/2018/07/09/face-clustering-with-python Do you have any suggestions?

lfcnassif commented 1 year ago

DBScan seems a good choice. If the python implementation performance is bad, for sure there are some java implementations out there, since it is a classic clustering algorithm. This would also avoid the need to manually install another python dependency, but since face detection already needs manual installation, I'm ok with it.

hauck-jvsh commented 1 year ago

Now it is grouping the item by any face inside the item, but the information about what face is in the group is lost. Maybe there is another way to store this info.

hauck-jvsh commented 1 year ago

The python lib is presenting the following error: OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata. OOOOOOOOOppenBLAS : Program is Terminated. Because you tried to allocate too many memory regions.

The current solution I found is to set the environment variable OPENBLAS_NUM_THREADS to 4.

hauck-jvsh commented 1 year ago

Maybe the best solution is to change the python task to a java one, and mantain only the FaceRecognitionProcess as a python code. This would allow the use of a java DBScan lib for clustering, bypassing the python thread problems. What do you think? @lfcnassif

lfcnassif commented 1 year ago

This is possible, but I think it would improve performance just if the java library is multithreaded. I've found this in the past: https://github.com/haifengl/smile

But it seems single threaded at first sight...