{"id":15037625,"url":"https://github.com/prmelehan/swifty-ml","last_synced_at":"2025-04-09T23:24:29.783Z","repository":{"id":96547593,"uuid":"112117160","full_name":"prmelehan/Swifty-ML","owner":"prmelehan","description":"Converts Keras models to Core ML models for use on iOS","archived":false,"fork":false,"pushed_at":"2017-12-31T16:16:39.000Z","size":14,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T01:13:25.781Z","etag":null,"topics":["converter","coremltools","keras","ml","python3","swift-3"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/prmelehan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-26T21:14:06.000Z","updated_at":"2025-02-04T20:33:28.000Z","dependencies_parsed_at":"2023-04-02T11:49:49.315Z","dependency_job_id":null,"html_url":"https://github.com/prmelehan/Swifty-ML","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/prmelehan%2FSwifty-ML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prmelehan%2FSwifty-ML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prmelehan%2FSwifty-ML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prmelehan%2FSwifty-ML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prmelehan","download_url":"https://codeload.github.com/prmelehan/Swifty-ML/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248127207,"owners_count":21052209,"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":["converter","coremltools","keras","ml","python3","swift-3"],"created_at":"2024-09-24T20:35:08.419Z","updated_at":"2025-04-09T23:24:29.763Z","avatar_url":"https://github.com/prmelehan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swifty-ML\n### Train and convert Keras models to Core ML models easily\n\n## Features\n\n* Train a CNN with only images\n* Convert pre-trained keras models to Core ML models\n* Train and Convert a CNN into a Core ML Model\n* Edit attributes of existing Core ML Models\n\n## Why does this exist?\n\nSwifty-ML allows developers with no experience in ML to create classifiers and improve their apps. It's also good for playing around!\n\n\n\n## Requirements\n\n* [Keras](https://keras.io/#installation)\n* [coremltools](https://github.com/apple/coremltools#installation)\n* Python 3.6\n\n## Usage\n\nTo train a model using Swifty-ML, run the following command in terminal.\n```\npython modeler.py train path/to/data inceptionv3\n```\n\nThis usually takes a very long time, even with a good laptop, but once finished, there will be two files. A `Core ML Model` and a `Keras .h5` model. Saved in `exported_models/coreml` and `exported_models/keras` respectively. The system also saves the state of the model during training after each epoch.\n\nTo edit a coreml model...\n```\npython modeler.py edit path/to/coreml/model.mlmodel\n```\n\nTo convert a Keras model (.h5) to CoreML format\n\n```\npython modeler.py convert-pre-trained path/to/keras/model.h5\n```\n\n## Data Directory Format\n\nThe format for training and validation images must be the following\n\n```\n.\n├── training\n│   ├── class1\n│   ├── class2\n│   └── class3\n└── validation\n    ├── class1\n    ├── class2\n    └── class3\n```\n\nIf I was training a network on images of the different flags, I would have a structure like so...\n\n```\n.\n├── training\n│   ├── belgium\n│   ├── canada\n│   └── unites_states\n└── validation\n    ├── belgium\n    ├── canada\n    └── unites_states\n```\n\nNote: `training` and `validation` cannot change, but the sub folders' names can, and will be the class labels for the images inside them.\n\n## Installing Core ML Tools on Python 3.6\n\nAs of now, Core ML Tools does not provide support for Python 3.6 via `pip`. Instead, you will need to download the latest version from their GitHub and install it manually.\n\nhttps://github.com/apple/coremltools\n\nAfter downloading the project, `cd` into the project and run\n```\npython setup.py install\n```\n\n## Supported models\n\nAs of now, only a few model architectures are supported. In the future, all models supported by both `coremltools` and `keras` will be supported.\n\nFuture models include\n\n- [ ] Xception\n- [x] VGG16\n- [x] VGG19\n- [ ] ResNet50\n- [x] InceptionV3\n- [ ] InceptionResNetV2\n- [x] MobileNet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprmelehan%2Fswifty-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprmelehan%2Fswifty-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprmelehan%2Fswifty-ml/lists"}