is there a plugin that you can install to detect faces when a user uploads an image? We want to enforce having a profile picture but some of our users that sign up/ login with Gmail don’t have any profile pictures for us to attach to their profile pictures.
@sudsy I rather thing he’s looking for face detection and not face recognition.
He simply want to know if an uploaded photo contains a human face. Not a any particular human (that will be recognition) but any human face.
@calvin1 if you google facial detection api you will likely find one that meets your need.
You could even create your own face detection api hosted on Algorithmia if you’re comfortable with some basic coding.
I know there are already some existing face detection api in algorithmia but they may not be free.
If all you’re interested in is to detect if an image is not one of those gmail letter faces then that’s even a simple problem.
You can simply count the number of colors in the image and if its two, then it’s one of those gmail placeholder images. Those images are always made up of a background colour and white single or double character.
There are many libraries including client-side ones that can quickly count number of colors in an image in plain javascript.
Now note that such an implementation will accept anything other than the gmail placeholder images.
So someone having the picture of a tree will still be seen as a valid profile picture. Maybe thats what you want because people use different images as profile picture. Case in point, my profile picture in this forum.
Even if you went with a true face recognition algorithm, a lot of the basic fast ones can only accurately detect frontal faces.
Personally I will recommend you go with the color detection approach I describe since you shouldn’t what kind of photo someone wants to use as their profile photo. I for one will be angry if whatever algorithm you’re using refuse to accept my profile picture on this forum as a valid photo.
@marcusandrews that can work.
Only consideration is that Clarifai is not a free service.
Also I’m concerned when a service is going to index images i sent to it. From the plugin description:
Clarifai’s Search API takes image inputs from a user and creates a search index, which users can later search by keyword or by inputting other images.
Are you going to get your users consent before sending their photos to a third-party service that may index their photos?
I think his problem is very simple and he can cook up some simple local solution himself.
Do you know how to set it up on algorithma so that the submission of the photo, has face detection? Making it so the users can only upload photos of their face?