0

I am currently using google cloud-vision api for a project. I want to assign a unique ID to a face, so that it automatically detects which IDs any image contains. This way I can know which person is in the image.

Can cloud-vision distinguish faces and return some unique ID for a face?

Lord Grim
  • 39
  • 4

2 Answers2

1

The Vision API service offers a Face Detection feature that can be used to detect multiple faces within an image along with the associated key facial attributes such as emotional state or wearing headwear. Based on this, you can get the bounding polygon around the face, the land marks, roll angle, detection confidence, among other properties; however, it is important to note that this feature doesn't support Facial Recognition, which means that it cannot be used to retrieve unique IDs for the faces detected.

In case this feature doesn't cover your current needs, you can use the Send Feedback button, located at the lower left and upper right corners of the service public documentation, as well as take a look the Issue Tracker tool in order to raise a Vision API feature request and notify to Google about this desired functionality.

Armin_SC
  • 1,849
  • 8
  • 13
1

NO, and as Armin has already mentioned, Google Vision API doesn't support Facial Recognition or Face verification. It only performs face detection on an image. What you can actually do is to use tensorflow to complete what you want. Let me explain for you:

A typical face recognition system (pipeline) consists of couple of phases :

  1. Face detection: which you can do it by using Google Vision API
  2. Facial features extraction: which you can do by using tensorflow to extract facial features and get face embeddings of each detected face from step 1. Extracting the facial features could be done by using pre-trained model which are trained on large datasets like (VGGFace2, CASIA-WebFace).
  3. Face recognition (identification or verification): which you can achieve by using
    • Tensorflow to read the face embeddings (which are fetched and saved in step 2) from the desk (it could be also fetched from a database, it depends where you have saved them)
    • Support Vector Machines (SVM) in python to do multi-class classification.

(IMO) The most important things in face recognition systems are correctly detecting faces and correctly extracting facial features. The third step is just a classification problem and it can be done in many ways, you can also for example use the Euclidean distance between the facial embeddings to know if two faces are similar or not (identify).

For the second and the third step you can take a look at FaceNet https://github.com/davidsandberg/facenet which is great example how you can develop your own facial recognition system based on tensorflow.

Peshmerge
  • 823
  • 1
  • 11
  • 25
  • Thanks for the answer. It really helps to know that I can combine Cloud Vision Api with Tensorflow and recognise faces using it. – Lord Grim Nov 08 '18 at 14:06
  • 1
    Don't hesitate asking further questions :) And if you are still looking for one solution that has detection and recognition, take a look at MachineBox https://machinebox.io/docs/facebox and if you want to test it look at this script for fast prototyping and testing https://github.com/peshmerge/facebox_python – Peshmerge Nov 09 '18 at 08:02