Reputation: 393
I try using Google Vision API with one use case study to detect people face wearing mask, as a result from API response as well as web-ui demo https://cloud.google.com/vision/docs/drag-and-drop, I can not get the right result how to determine people wearing a mask or not.
Appreciate your help.
Upvotes: 0
Views: 1481
Reputation: 11
The Google Cloud Vision API is a machine learning model that is "pre-trained". I tried running an image of a person wearing a mask through the API Demo site. Demo site: https://www.gstatic.com/cloud-site-ux/vision/vision.min.html. It was able to recognize it was a face, but it did not find any "mask" objects or labels.
Since the GCP Vision API hasn't been trained to recognize a mask as an object or label, it is not going to work for your application. Luckily, Google Cloud offers another product that lets you create your own machine learning model, and you could train it to recognize people with and without masks.
Look into Google AutoML Object Detection at https://cloud.google.com/automl/docs. This is what you'll want to use. AutoML Object Detection enables you to train a custom model to detect objects in an image with bounding boxes and labels. AutoML Image Classification is similar, but it will not specify the bounding box of an object; it will just be able to tell you generally that the image has a mask in it (LABEL_DETECTION).
You will need to supply it with sample images - ie. images of people WITH masks. The more images you supply it with, the more accurate it gets at identifying objects in your images. Use images with different lighting, angles, masks colors and types, etc. Google recommends 50,000 images for training. More info on preparing images for training, here: https://cloud.google.com/vision/automl/docs/prepare
You can get started with this GCP product at https://console.cloud.google.com/vision.
Upvotes: 1