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.txtBefore running any script, run:
source ./bin/activateDownloads 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.pypython scripts/quantize.py -i ./models/BeerClassifier.mlmodel -o ./models/BeerClassifierQuantized.mlmodelCrops and resize all images.
python scripts/keras/preprocess.pyCreates train_data.csv and test_data.csv.
python scripts/keras/create_data_csv.pyTrains using collected images to create model file.
python scripts/keras/train.pyConverts keras model (in HDF5) file to .mlmodel format.
python scripts/keras/hdf5_to_mlmodel.pyConvert images to turicreate-supporting formats.
python scripts/turicreate/convert_image_format.pyCreate an sframe file from prepared images.
python scripts/turicreate/create_sframe.pyTrains using prepared images and and sframe file to create model file.
python scripts/turicreate/train.py