/fruit-classifier

Fruit classifier assignment

Primary LanguagePython

Fruit classifier

Build Status codecov Python PEP8

This is repo is one of the assignments given at the AI workshop on pre-processing given the 23rd of April 2019

This assignment is loosely based on this tutorial from pyimagesearch.

Task

In this assignment you have to do distinguish various kinds of fruit. No dataset is given, so you either have to bring your own dataset or scrape something of the internet. In any case you will need to clean and pre-process the data prior to model ingestion.

Furthermore, you should make your own test set (with your mobile camera) based on fruit in your local vicinity (or any other object you choose to classify). Note that a couple of photos for each class should suffice for this toy-model.

Pre-processing

In the pre-processing part of the assignment your task is to enhance the code in fruit_classifier/preprocessing.

Usage

  1. Download the requirements in requirements.txt

  2. Download the chromedriver based on your operating system, and store it to the root directory of this repository

  3. Scrape images with python -m fruit_classifier.data_scraping

  4. Clean the data with python -m fruit_classifier.preprocessing

  5. Train with python -m fruit_classifier.train

  6. Predict with python -m fruit_classifier.predict -i <path_to_image>

    Example: python -m fruit_classifier.predict -i "test\test_data\raw_data\bananas\1. banana-1.png"

Troubleshooting

Question: I've done all the assignments and have literally nothing to do

Answer: Congratulations! Now you can try to locate the class in the image (also known as object detection). You can use tools like labelImg to do this. NOTE: We only ask you to label, if you are really eager you could also try to change the model so that you get a bounding box, but note that this is not a task which is done in 4 hours (see for example the original YOLO paper if you are interested).


Question: I've gone through the painful experience of labeling data, what do I do now?

Answer: You may have noticed that there are several places where the code can be improved. Why don't you give it a try and make a pull request with your improvements.