Skip to content

Repository files navigation

Variable Image Classification

A repository to demonstrate handling variable input shapes for image classification

Dataset

Imagenette dataset with 160px version is used to demonstrated in this repository.

Prerequisites

  • Python 3.8
  • wget

Setup

  1. Clone the repository
git clone https://github.com/luangtatipsy/variable-image-classification.git
cd variable-image-classification
  1. Create and activate a virtual environment for Python (recommended). If you do not prefer using a virtual environment, skip to step 4.
python -m venv env
source env/bin/activate
  1. Update pip to latest version
python -m pip install --upgrade pip
  1. Install requirements
python -m pip install -r requirements.txt

Dataset Preparation

  1. Download the dataset
wget https://s3.amazonaws.com/fast-ai-imageclas/imagenette2-160.tgz
  1. Extract the downloaded tgz file
mkdir datasets && tar zxvf imagenette2-160.tgz -C ./datasets
  1. Rename the directory
mv ./datasets/imagenette2-160/ ./datasets/imagenette2/
  1. (Optional) Remove the tgz file
rm -f imagenette2-160.tgz

Training an Image Classification Model

01-train.ipynb notebook is used to train the fixed and variable input shape image classification model with the downloaded data.

Pre-trained Model

Pre-trained models can be download by the following...

Place the models to models directory or run the commands below..

wget https://www.dropbox.com/s/na4pn0wggcdbjjb/fixed-imagenette2.h5 -O models/fixed-imagenette2.h5
wget https://www.dropbox.com/s/mbw0jdb86s0xw1a/variable-imagenette2.h5 -O models/variable-imagenette2.h5

License

This repository is distributed under MIT License

About

A repository to demonstrate handling variable input shapes for image classification

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages