A repository to demonstrate handling variable input shapes for image classification
Imagenette dataset with 160px version is used to demonstrated in this repository.
- Python 3.8
- wget
- Clone the repository
git clone https://github.com/luangtatipsy/variable-image-classification.git
cd variable-image-classification- 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- Update pip to latest version
python -m pip install --upgrade pip- Install requirements
python -m pip install -r requirements.txt- Download the dataset
wget https://s3.amazonaws.com/fast-ai-imageclas/imagenette2-160.tgz- Extract the downloaded
tgzfile
mkdir datasets && tar zxvf imagenette2-160.tgz -C ./datasets- Rename the directory
mv ./datasets/imagenette2-160/ ./datasets/imagenette2/- (Optional) Remove the
tgzfile
rm -f imagenette2-160.tgz01-train.ipynb notebook is used to train the fixed and variable input shape image classification model with the downloaded data.
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.h5This repository is distributed under MIT License