This project uses a dataset of fruit and vegetable images for classification using deep learning.
The dataset contains images of 36 different classes of fruits and vegetables, organized into training, validation, and test sets.
Dataset Source: Vegetable Image Dataset on Kaggle
- Install Kaggle CLI (if not already installed):
pip install kaggle-
Set up Kaggle API Credentials:
- Go to your Kaggle account settings (https://www.kaggle.com/settings)
- Scroll to "API" section and click "Create New API Token"
- This will download a
kaggle.jsonfile - Create a
.kaggledirectory in your user home:- Windows:
C:\Users\<Windows-username>\.kaggle - Linux/Mac:
~/.kaggle
- Windows:
- Move the downloaded
kaggle.jsonfile to this directory
-
Download the Dataset:
kaggle datasets download misrakahmed/vegetable-image-dataset- Extract the Dataset:
# Windows PowerShell
Expand-Archive -Path vegetable-image-dataset.zip -DestinationPath Fruits_Vegetables
# Linux/Mac
unzip vegetable-image-dataset.zip -d Fruits_VegetablesFruits_Vegetables/
├── train/
│ ├── apple/
│ ├── banana/
│ ├── beetroot/
│ └── ...
├── validation/
│ ├── apple/
│ ├── banana/
│ ├── beetroot/
│ └── ...
└── test/
├── apple/
├── banana/
├── beetroot/
└── ...
- Fruits: apple, banana, grapes, kiwi, lemon, mango, orange, pear, pineapple, pomegranate, watermelon
- Vegetables: beetroot, bell pepper, cabbage, capsicum, carrot, cauliflower, chilli pepper, corn, cucumber, eggplant, garlic, ginger, jalepeno, lettuce, onion, paprika, peas, potato, raddish, soy beans, spinach, sweetcorn, sweetpotato, tomato, turnip
- Clone this repository:
git clone https://github.com/Thakshana22/Image-Classification.git
cd Image-Classification- Install required Python packages:
pip install -r requirements.txt- Make sure the dataset is extracted in the correct directory structure as shown above.
- The dataset is already split into training, validation, and test sets
- Images are in various resolutions and formats
- Make sure you have enough disk space (~2GB) before downloading the dataset
Please refer to the dataset's Kaggle page for licensing information.