Using GCP Vision API to Detect Similar Images in the Web

Google Cloud Platform's Vision APIs can detect web references for an image, finding similar images from the web.

Setup

We'll use gradio for the user interface, The GCP Vision AI API and Cloud Run to deploy our demo.

  1. Build the docker image and push to GCP's container repository. Make sure to substitute the project id below with yours.

    docker build . -t gcr.io/<project_id>/vision-api-detect-web-entities:latest
    docker push gcr.io/<project_id>/vision-api-detect-web-entities:latest
  2. Deploy the image to cloud run

    gcloud run deploy --port 80 vision-api-demo --image gcr.io/<project_id>/vision-api-detect-web-entities:latest --region us-central1
  3. When this is deployed, you'll get a URL where you can access the webui. Make the url public by following this link. You might have organizational policies that don't allow public internet to access your instance. If that's the case, add Domain restricted sharing to All. Be aware this can create a security loophole.