{"id":15561242,"url":"https://github.com/colbylwilliams/customvision","last_synced_at":"2026-05-16T22:02:42.090Z","repository":{"id":56906983,"uuid":"129479831","full_name":"colbylwilliams/CustomVision","owner":"colbylwilliams","description":"Swift SDK for Microsoft Custom Vision","archived":false,"fork":false,"pushed_at":"2019-08-15T02:40:57.000Z","size":147,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-15T15:44:48.685Z","etag":null,"topics":["cognitive-services","custom-vision","ios","macos","microsoft","microsoft-cognitive-services","sdk","swift"],"latest_commit_sha":null,"homepage":null,"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/colbylwilliams.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":"2018-04-14T03:58:41.000Z","updated_at":"2019-08-15T02:40:59.000Z","dependencies_parsed_at":"2022-08-21T03:20:51.606Z","dependency_job_id":null,"html_url":"https://github.com/colbylwilliams/CustomVision","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/colbylwilliams/CustomVision","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colbylwilliams%2FCustomVision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colbylwilliams%2FCustomVision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colbylwilliams%2FCustomVision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colbylwilliams%2FCustomVision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colbylwilliams","download_url":"https://codeload.github.com/colbylwilliams/CustomVision/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colbylwilliams%2FCustomVision/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33120450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cognitive-services","custom-vision","ios","macos","microsoft","microsoft-cognitive-services","sdk","swift"],"created_at":"2024-10-02T16:06:43.793Z","updated_at":"2026-05-16T22:02:42.050Z","avatar_url":"https://github.com/colbylwilliams.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CustomVision\n\nSwift SDK for Microsoft's [Custom Vision Service](https://www.customvision.ai)\n\n## Features\n\n- [x] [Custom Vision Training API 3.0](https://southcentralus.dev.cognitive.microsoft.com/docs/services/Custom_Vision_Training_3.0)\n- [x] [Custom Vision Prediction API 3.0](https://southcentralus.dev.cognitive.microsoft.com/docs/services/Custom_Vision_Prediction_3.0)\n- [x] Work with `UIKit` \u0026 `Foundation` objects like `UIImage`\n- [x] Export \u0026 Download `CoreML` models for use offline\n- [ ] Sample App\n\n## Requirements\n\n- iOS 11.0+ / Mac OS X 10.11+ / tvOS 9.0+ / watchOS 2.0+\n- Xcode 9.3+\n- Swift 4.1+\n- [Custom Vision](https://www.customvision.ai/) Account\n\n## Installation\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n...\n$ brew install carthage\n```\n\nTo integrate CustomVision into your Xcode project using Carthage, specify it in your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile):\n\n```cartfile\ngithub \"colbylwilliams/CustomVision\"\n```\n\nRun `carthage update` to build the framework and drag the built `CustomVision.framework` into your Xcode project.\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.\nYou can install it with the following command:\n\n```bash\n[sudo] gem install cocoapods\n```\n\n\u003e CocoaPods 1.3+ is required.\n\nTo integrate the Azure.iOS into your project, specify it in your [Podfile](http://guides.cocoapods.org/using/the-podfile.html):\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '12.0'\nuse_frameworks!\n\npod 'CustomVision', '~\u003e 1.0'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n...\n```\n\n### Swift Package Manager\n\n_Coming soon_\n\n## Usage\n\nTo get started using CustomVision, you need to provide the SDK with your [Training Key](https://www.customvision.ai/projects#/settings) and [Prediction Key](https://www.customvision.ai/projects#/settings).\n\nIf you're working with a single [project](https://www.customvision.ai/projects), you can also provide a default Project ID that will be used for every project operation _(instead of passing it in as a parameter every time)_.\n\nThere are two ways to provide the Training Key, Prediction Key, and Project ID; programmatically, or by adding them to a plist file:\n\n### Programmatically\n\nThe simplest way to provide these values and start using the SDK is to set the values programmatically:\n\n```swift\nCustomVisionClient.defaultProjectId     = \"CUSTOM_VISION_PROJECT_ID\"\nCustomVisionClient.subscriptionRegion   = \"CUSTOM_VISION_PROJECT_ID\"\nCustomVisionClient.shared.trainingKey   = \"CUSTOM_VISION_TRAINING_KEY\"\nCustomVisionClient.shared.predictionKey = \"CUSTOM_VISION_PREDICTION_KEY\"\n\nCustomVisionClient.shared.getIterations { r in\n    // r.resource is [Iteration]\n}\n```\n\n### Plist File\n\nAlternatively, you can provide these values in your project's `info.plist`, a separate [`CustomVision.plist`](https://github.com/colbylwilliams/CustomVision/blob/master/CustomVision/CustomVision.plist), or provide the name of your own plist file to use.\n\nSimply add the `CustomVisionTrainingKey`, `CustomVisionPredictionKey`, `CustomVisionProjectId`, and `CustomVisionSubscriptionRegion` keys and provide your Training Key, Prediction Key, and default Project ID respectively.\n\n**_Note: This method is provided for convenience when quickly developing samples and is not recommended to ship these values in a plist in production apps._**\n\n#### Info.plist\n\n```plist\n...\n\u003cdict\u003e\n    \u003ckey\u003eCFBundleName\u003c/key\u003e\n    \u003cstring\u003e$(PRODUCT_NAME)\u003c/string\u003e\n    \u003ckey\u003eCustomVisionProjectId\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_PROJECT_ID\u003c/string\u003e\n    \u003ckey\u003eCustomVisionTrainingKey\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_TRAINING_KEY\u003c/string\u003e\n    \u003ckey\u003eCustomVisionPredictionKey\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_PREDICTION_KEY\u003c/string\u003e\n    \u003ckey\u003eCustomVisionSubscriptionRegion\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_SUBSCRIPTION_REGION\u003c/string\u003e\n...\n```\n\n#### CustomVision.plist\n\nOr add a [`CustomVision.plist`](https://github.com/colbylwilliams/CustomVision/blob/master/CustomVision/CustomVision.plist) file.\n\n```plist\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    \u003ckey\u003eCustomVisionProjectId\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_PROJECT_ID\u003c/string\u003e\n    \u003ckey\u003eCustomVisionTrainingKey\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_TRAINING_KEY\u003c/string\u003e\n    \u003ckey\u003eCustomVisionPredictionKey\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_PREDICTION_KEY\u003c/string\u003e\n    \u003ckey\u003eCustomVisionSubscriptionRegion\u003c/key\u003e\n    \u003cstring\u003eCUSTOM_VISION_SUBSCRIPTION_REGION\u003c/string\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\n```\n\n#### Named plist\n\nFinally, you can `CustomVisionTrainingKey`, `CustomVisionPredictionKey`, `CustomVisionProjectId`, and `CustomVisionSubscriptionRegion` key/values to any plist in your project's **main bundle** and provide the name of the plist:\n\n```swift\nCustomVisionClient.shared.getKeysFrom(plistNamed: \"SuperDuperDope\")\n```\n\n## Training Images\n\nThe CustomVision SDK adds several convenience functions to make uploading new training images to your project as easy as possible.\n\nThis example demonstrates creating a new Tag in the Custom Vision project, then uploading several new training images to the project, tagging each with the newly created tag:\n\n```swift\nlet client = CustomVisionClient.shared\n\nlet tag = \"New Tag\"     // doesn't exist in project yet\nlet images: [UIImage] = // several UIImages\n\nclient.createImages(from: images, withNewTagNamed: name) { r in\n    // r.resource is ImageCreateSummary\n}\n```\n\n## Export \u0026 Download CoreML models\n\nOne of the most useful features of this SDK is the ability to re-train your Project, export the newly trained model (Iteration), download to the phone's file system, and compile the model on-device for use with `CoreML`.\n\n```swift\nfunc updateUser(message: String) {\n    // update user\n}\n\nlet client = CustomVisionClient.shared\n\nclient.trainAndDownloadCoreMLModel(withName: \"myModel\", progressUpdate: updateUser) { (success, message) in\n\n}\n```\n\nOnce the compiled model is persisted to the devices filesystem (above) you get the url of the model using the client's `getModelUrl()` func:\n\n```swift\nif let url = client.getModelUrl() {\n    let myModel = try MLModel(contentsOf: url)\n}\n```\n\n## License\n\nLicensed under the MIT License.  See [LICENSE](License) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolbylwilliams%2Fcustomvision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolbylwilliams%2Fcustomvision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolbylwilliams%2Fcustomvision/lists"}