{"id":15562995,"url":"https://github.com/shingt/beerclassifier","last_synced_at":"2025-04-23T23:15:05.321Z","repository":{"id":28027221,"uuid":"114346253","full_name":"shingt/BeerClassifier","owner":"shingt","description":"Sample app to classify beer bottle using Keras / Turi Create and Core ML.","archived":false,"fork":false,"pushed_at":"2022-12-08T02:02:30.000Z","size":26940,"stargazers_count":13,"open_issues_count":12,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T23:14:35.867Z","etag":null,"topics":["coreml","ios","keras","python","swift","vision-framework"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shingt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-15T08:26:04.000Z","updated_at":"2025-02-24T04:13:14.000Z","dependencies_parsed_at":"2023-01-14T08:45:11.790Z","dependency_job_id":null,"html_url":"https://github.com/shingt/BeerClassifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shingt%2FBeerClassifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shingt%2FBeerClassifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shingt%2FBeerClassifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shingt%2FBeerClassifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shingt","download_url":"https://codeload.github.com/shingt/BeerClassifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528899,"owners_count":21445518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coreml","ios","keras","python","swift","vision-framework"],"created_at":"2024-10-02T16:17:03.787Z","updated_at":"2025-04-23T23:15:05.304Z","avatar_url":"https://github.com/shingt.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BeerClassifier\n\nClassify your beer bottle images using Core ML and Keras / Turi Create.  \nDemo app for this presentation: [Core ML 🏃 iOS Engineer](https://speakerdeck.com/_shingt/core-ml-ios-engineer)\n\n\u003cimg width=200 src=\"https://user-images.githubusercontent.com/1391330/34070759-3e81a024-e2af-11e7-95c8-6f63297d8688.gif\"\u003e\n\nNote that after I tap `Download New Model`, app starts recognizing `Ho*gaarden` as well.\n\n## Requirements\n\n* Swift 4.2\n* Xcode 10.0\n* Python 3.6\n* virtualenv\n* pip\n\n## Setup\n\n```sh\nvirtualenv -p python3 ./\nsource ./bin/activate\npip install -r requirements.txt\n```\n\n## Usage\n\nBefore running any script, run:\n\n```sh\nsource ./bin/activate\n```\n\n## General scripts\n\n### `scraper.py`\n\nDownloads images using Microsoft Cognitive API.\nNote that you need to register Azure and set your azure key as `AZURE_KEY` in `.env`.\n\n```sh\npython scripts/scraper.py\n```\n\n### `quantize.py`\n\n```sh\npython scripts/quantize.py -i ./models/BeerClassifier.mlmodel -o ./models/BeerClassifierQuantized.mlmodel\n```\n\n## Keras-targetted scripts\n\n### `keras/preprocess.py`\n\nCrops and resize all images.\n\n```sh\npython scripts/keras/preprocess.py\n```\n\n### `keras/create_data_csv.py`\n\nCreates `train_data.csv` and `test_data.csv`.\n\n```sh\npython scripts/keras/create_data_csv.py\n```\n\n### `keras/train.py`\n\nTrains using collected images to create model file.\n\n```sh\npython scripts/keras/train.py\n```\n\n### `keras/hdf5_to_mlmodel.py`\n\nConverts keras model (in HDF5) file to `.mlmodel` format.\n\n```sh\npython scripts/keras/hdf5_to_mlmodel.py\n```\n\n## TuriCreate-targetted scripts\n\n### `turicreate/convert_image_format.py`\n\nConvert images to turicreate-supporting formats.\n\n```sh\npython scripts/turicreate/convert_image_format.py\n```\n\n### `turicreate/create_sframe.py`\n\nCreate an sframe file from prepared images.\n\n```sh\npython scripts/turicreate/create_sframe.py\n```\n\n### `turicreate/train.py`\n\nTrains using prepared images and and sframe file to create model file.\n\n```sh\npython scripts/turicreate/train.py\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshingt%2Fbeerclassifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshingt%2Fbeerclassifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshingt%2Fbeerclassifier/lists"}