Classify your beer bottle images using Core ML and Keras / Turi Create.
Demo app for this presentation: Core ML 🏃 iOS Engineer
Note that after I tap Download New Model
, app starts recognizing Ho*gaarden
as well.
- Swift 4.2
- Xcode 10.0
- Python 3.6
- virtualenv
- pip
virtualenv -p python3 ./
source ./bin/activate
pip install -r requirements.txt
Before running any script, run:
source ./bin/activate
Downloads images using Microsoft Cognitive API.
Note that you need to register Azure and set your azure key as AZURE_KEY
in .env
.
python scripts/scraper.py
python scripts/quantize.py -i ./models/BeerClassifier.mlmodel -o ./models/BeerClassifierQuantized.mlmodel
Crops and resize all images.
python scripts/keras/preprocess.py
Creates train_data.csv
and test_data.csv
.
python scripts/keras/create_data_csv.py
Trains using collected images to create model file.
python scripts/keras/train.py
Converts keras model (in HDF5) file to .mlmodel
format.
python scripts/keras/hdf5_to_mlmodel.py
Convert images to turicreate-supporting formats.
python scripts/turicreate/convert_image_format.py
Create an sframe file from prepared images.
python scripts/turicreate/create_sframe.py
Trains using prepared images and and sframe file to create model file.
python scripts/turicreate/train.py