DEV Community

Dhiraj Patra
Dhiraj Patra

Posted on

Reverse Image Search with Google Cloud

Almost every marketplace e-commerse system now trying Machine Learning or Deep Learning to leverage their sales. Like recommendation system, trail room and reverse image search.
What is reverse image search?

Say you liked one shoe image at Instagram. Then you can scan that image and with the help of reverse image search will find out where you can buy the similar shoe.

So this is really wonderful for marketplace companies as well. Also you referal marketing companies can use this reverse search engine as a powerful tool for them. Each search result link will be a deep link for a specific product into one e-commerce site. So when a person click on that link to go and purchase that product. Marketing company will earn the referral bonus as well.

Lets start with Google Cloud Free version
Setting up Vision API in your project.

Go to your project browser and select one you want to work with in Google Cloud Platform.

https://console.cloud.google.com/

If no project exist then you have to create a project.

After that go to https://console.cloud.google.com/apis/api/vision.googleapis.com/

Enable the API

Then go to https://console.cloud.google.com/storage/ and create a Cloud Storage bucket. Give the bucket permission as fine-grain.

In the Cloud Console, go to the Cloud Storage Browser page.
Click Create bucket.

In the Create bucket dialog, specify the following attributes:
Name: A unique bucket name. Do not include sensitive information in the bucket name, because the bucket namespace is global and publicly visible.

Default storage class: Standard

A location where bucket data will be stored.
Click Create.

After bucket creating we need to upload a image to test for reverse image search with API.

Upload a image to the bucket like below:

Alt Text

After the file is uploaded and listed in the Cloud Storage Browser, share the image publicly. Here you need to give the permission for your image object. So that public can view from the browser.

You will get a public url for you image.

Open the API Explorer from your Cloud Vision API page of your cloud consol admin panel.

You can test your image public url. Or you can use this https://cloud.google.com/vision

Also you can get the code tutorial here https://cloud.google.com/vision/product-search/docs/tutorial

Top comments (0)