flutterfirebasegoogle-cloud-platformgoogle-cloud-storagegoogle-product-search

Cloud Api Product Search asked for storing the images in the google cloud storage, but can i store them in the firebase storage as alternative?


I'm using the Cloud Api product search, they ask me to store the images and the csv file in the google cloud storage but i'm already using firebase in my project and my images stored there so can i choose firebase than the google cloud ?


Solution

  • Yes, you can use it as an alternative. As Renaud Tarnec commented, Firebase Storage underneath is Google Cloud Storage. This means that any bucket in your Firebase console is actually a regular Google Cloud Storage bucket.

    You can confirm this by creating a Storage Bucket in the Firebase console and uploading objects to it (images for your dataset and the CSV file). If you access the Cloud Storage page in the GCP console, the same bucket and objects will be there.

    As for using the Vision Product Search API with Firebase Storage, I followed this quickstart guide, but edited the CSV file to point to images that were uploaded to the default Firebase Storage bucket (PROJECT-ID.appspot.com).

    After letting the dataset images index, I was then able to send an image to be compared to the dataset as expected.

    Keep in mind the service account you use to create a Vision API dataset must be able to read Cloud Storage Objects to access the images in your Firebase Storage bucket. Let me know if this was useful.