mardi, juillet 21, 2020

Running MTCNN on my own photos

Purpose

The aim of this post is to share my own experience of running a MTCNN (Multi-task Cascaded Convolutional Neural Network) on my own images.

I ran MTCCN on some of my photographs in order to extract faces out of photos.


Dolls

The first example is a photo of dolls in my garden:

After running the code, the extracted faces are:
Here we can observe that only the two dolls and the "Pierrot" are extracted. It's logic as their faces are much like humans and with some 3D aspect that is not the case for the other characters (flat faces)

Amsterdam marathon

The second example I ran was the photos taken during the Amsterdam marathon, first photo during the race:
And the extracted faces are:

Here we can observe that the algorithm is correctly extracting faces in the first plan, and is even good for extracting the faces in the back, of course with less accuracy.

The second photo at the finish:

An the extracted faces are:
Here we can observe that there is an outlier on the right handside: MTCNN has identified the arm as a face :=(

La Famille Belier

The last example is taken out of a photos of celebrities, a photo from the poster of the film "La Famille Bélier":

An the extracted faces are:

The code

Conclusion

  • The code is pretty simple if you simply use the Keras libraries. From the different examples, I observe the MTCNN is pretty efficient at distinguishing human faces out of non human faces.
  • The time for execution is also fast.
  • The next steps I might explore is how to attach the names of the celebrities given their photos, and give a legend to some photos. I will explore this with LTSM (Long Short Term Memory) neural network.
  • A big thanks to Jason Brownlee.




1 commentaire:

Jason Brownlee a dit…

This is great work, well done!