Forum Documentation Showcase Pricing Learn more

Face Detector Plugin

#1

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.

Thanks

#2

Don’t think there’s a plugin, but Microsoft Azure has an API that might do the trick: https://azure.microsoft.com/en-us/services/cognitive-services/face/

#3

@petter, thanks for getting back to me, would we use the bubble API connector to connect with this azure api?

#4

Yes, I don’t know the specifics of this API, but usually the API Connector will do the trick.

#5

@petter thanks. Will let you know how this goes.

1 Like
#6

A couple things to consider:

  • Face detection is not the same as face recognition. It sounds like you’re looking for the latter.
  • I, for one, would be thoroughly annoyed if my mug (or an image that some AI thought was my mug) appeared in my profile without my explicit consent.
#7

@shot thats right, we want to recognize faces and make sure user’s profile pictures aren’t these random generated gmail letter faces…

#8

@shot 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.

#9

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.

An alternative to the color detection method is simply a letter/character recognition with tesseract.

#10

This might help, it detects the main contents of images:

#11

@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.

#12

Never really looked into that plugin, thanks for clarifying though.

#13

Oh, I see. I misunderstood. I thought the idea was to try to identify that specific user in an uploaded photo.

There appear to be quite a few services which offer APIs for facial recognition and detection.

#14

That might work much of the time, but I can see it returning a false positive for certain logos and such.

EDIT: (I wonder if anything could be gleaned by simply examining the URL and/or filename.)