This is our course project for CSL2050 Pattern Recognition and Machine Learning (2022 Winter Semester). The problem statement is: To recognise different fruits and vegetables from the given dataset using Machine Learning techniques.
The dataset we used is called Fruits360 - a dataset with 90380 images of 131 fruits and vegetables. The images are of dimensions 100px by 100px and are in RGB format.
Our task in this project was to build an end-to-end pipeline to classify the fruits and vegetables in the dataset. Our pipeline has the following functionalities:
- Loads pretrained VGG16 model
- Loads given image and processes it
- Predicts the class of given image
The pipeline has 7 methods – 2 public and 5 private. We can print the summary of the pipeline model using the summary() method. We can make predictions using the predict(image_path) method. While making a prediction, the input image is shown along with the model’s prediction. We also integrated this Pipeline in the website that we built for this project.
You must have the following packages installed in your working environment:
Python 3.8.0numpy==1.22.3Pillow==9.1.0Flask==2.1.1keras==2.8.0tensorflow==2.8.0
Next, Use git clone https://github.com/sawmill811/Fruits360.git in your terminal to clone the repository.
Type flask run in your terminal and go to http://localhost:5000/ to see the website. Ignore the TensorFlow warnings, if any. You should be able to see something like this:
Choose the image you want to predict and click on the Predict button. You should see the image along with the model’s prediction.