This project is my submission for the Fall 2021 Shopify Image Repository challenge.
This image repository allows users to add and search for images. A machine learning model extracts details from each of the images added, allowing for automatic labelling. For example, uploading the photo below generates the following labels from the machine learning model: Food Ingredient Fast food Bun Recipe Staple food Cuisine Dish Sandwich Baked goods. This allows users to search for images that were given a certain label, and get returned images that match that search criteria. With all of these steps abstracted away from the user, we can say goodbye to manual labelling!

- Enter a name for your image as well as an image URL. Image URL's can be obtained by right clicking on an image in Google Images and selecting
Copy Image Addresson MacOS or a Windows/Linux equivalent. - After submitting a valid image, it will be passed through Google's
Vision AImodel, which will assign labels to that inputted image. - The image will then be added to the database
- Enter some keyword to search for similar images. Some sample labels I tested with that are my favourites include:
food
cabinetry
water
cloud
building - Images with matching labels will then be queried and displayed to the user, along with the original assigned image name.
- Install the required dependencies through the
requirements.txtfile provided:
pip install -r requirements.txt- From there, launch the
Flaskserver:
python3 main.py- That's it, you will now be able to navigate to the
searchtab through the navigation window to search for images related to some label!
Some additional steps need to be taken to setup adding images need to be taken, namely in setting up Google Vision.
- First, create a project in GCP to enable billing, the vision API, and create a service account. Steps to do each of these tasks can be found here, as per Google's documentation.
- From there, after following those steps you should now have an api key as a json file. you can now set an the required environment variable with the following line:
export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/apiJsonKey"
- Install the client library to use the API:
pip install --upgrade google-cloud-vision
- That's it, now you will be able to add images and have them passed through the Google Vision API!