To run this on your machine:
- Make sure you have docker and get familiar with docker-compose
- Using the docker-compose file, spin up a weaviate instance along with image2vec module.
- Make sure to have the following python libraries installed, preferably in a virtual environment: a. weaviate b. pickle c. uuid d. flask e. urllib
- To add data to weaviate, run the veg_add.py file after downloading the dataset mentioned below. This will
add images to weaviate from folders mentioned in that file. You can add your own images too or use the dataset of your choice by just making a few small changes in the veg_add.py file. I have used a kaggle dataset (https://www.kaggle.com/datasets/misrakahmed/vegetable-image-dataset (https://www.researchgate.net/publication/352846889_DCNN-Based_Vegetable_Image_Classification_Using_Transfer_Learning_A_Comparative_Study)) to make this example. I have also deleted all the folders from the actual train folder of the dataset to make this example easier to download. Please make sure to download the dataset, add required folders from the train folder of that dataset to the train folder of this example (create a train folder and add the required image classes).
NOTE: Please make sure to change the image paths and uploads folder paths in veg_add.py file and upload.py file so as to avoid file not found errors.
- Now, to test the application, run the app.py file. This will start a flask server where you can upload an image and the application will classify it and display the class of vegetable it belongs to.
- You are encouraged to play with the code, make changes, test it, and have fun with weaviate 😇!!