{"id":20058663,"url":"https://github.com/roboflow/roboflow-ios-starter","last_synced_at":"2025-07-07T08:12:24.747Z","repository":{"id":60162623,"uuid":"535353213","full_name":"roboflow/roboflow-ios-starter","owner":"roboflow","description":"Official starter project for building iOS apps with Roboflow.","archived":false,"fork":false,"pushed_at":"2025-06-17T20:18:21.000Z","size":1645,"stargazers_count":16,"open_issues_count":1,"forks_count":3,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-07-07T08:11:54.417Z","etag":null,"topics":["ios","roboflow"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roboflow.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,"zenodo":null}},"created_at":"2022-09-11T16:14:25.000Z","updated_at":"2025-07-01T09:55:23.000Z","dependencies_parsed_at":"2025-07-07T08:11:25.559Z","dependency_job_id":null,"html_url":"https://github.com/roboflow/roboflow-ios-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roboflow/roboflow-ios-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Froboflow-ios-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Froboflow-ios-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Froboflow-ios-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Froboflow-ios-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roboflow","download_url":"https://codeload.github.com/roboflow/roboflow-ios-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Froboflow-ios-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264040949,"owners_count":23548074,"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":["ios","roboflow"],"created_at":"2024-11-13T13:03:09.434Z","updated_at":"2025-07-07T08:12:24.722Z","avatar_url":"https://github.com/roboflow.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roboflow-ios-sample\n\nThis project shows you how you can get started developing computer vision iOS apps with the [Roboflow SDK](https://blog.roboflow.com/roboflow-ios-sdk/). It uses a model trained to recognize whether a user is wearing a mask or not.. \n\nTo get started, you'll need to have [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12) installed, as well as [Cocoapods](Cocoapods). You can install Cocoapods by running either `sudo gem install cocoapods` (if you have Ruby installed) or `brew install cocoapods` (if you have the [Homebrew](https://brew.sh/) package manager installed).\n\nClone this [repository](https://github.com/roboflow-ai/roboflow-ios-starter), navigate to `roboflow-ios-starter/Roboflow Starter Project` directory and run `pod install`. This instals the Roboflow SDK in the project, ensuring it's ready for use.\n\n\n## Setting up Xcode \nOpen `Roboflow Starter Project.xcworkspace` with Xcode. Go to Xcode-\u003eSettings:\n\n![Xcode Settings](https://github.com/roboflow-ai/roboflow-ios-starter/blob/main/Screenshots/XcodeSettings.png)\n\nAnd click on Accounts: \n![Xcode Accounts](https://github.com/roboflow-ai/roboflow-ios-starter/blob/main/Screenshots/Accounts.png)\n\nTo add your account, click the + button, and follow the steps to add in your Apple ID:\n\n![Adding Apple ID](https://github.com/roboflow-ai/roboflow-ios-starter/blob/main/Screenshots/AppleID.png)\n\nOnce you’ve done that, go to the Signing \u0026 Capabilities section of Xcode: \n\n![Signing and Capabilities](https://github.com/roboflow-ai/roboflow-ios-starter/blob/main/Screenshots/SigningAndCapabilities.png)\n\nAnd add your Apple ID under “Team”. \n\n\n## Running the app on your Device\nBecause the app requires the use of the camera, it has to be run on a physical device to use its functionality; not the simulator. To do this, first make sure your iPhone or iPad has Developer Mode enabled. Once you’ve done that, your device will appear as an option in Xcode:\n\n![Running App on Physical iPhone from Xcode](https://github.com/roboflow-ai/roboflow-ios-starter/blob/main/Screenshots/RunningApp.png)\n\n\n## SDK Initialization\nThis project uses an API key generated specifically for this project, but if you have your own model, you can add your own API key in the `var API_KEY` in `ViewController.swift`\n\nThe SDK gets initialized in these two lines at the top of the View Controller: \n\n```\nlet rf = RoboflowMobile(apiKey: API_KEY)\nvar roboflowModel: RFObjectDetectionModel!\n```  \n\n## Setup Camera Session\nIn order to perform computer vision inference on the iPhone, we have to initialize a camera session. \n\nAfter ensuring that we have permission from the user to access the camera in `checkCameraAuthorization()`, we create our camera session in `setupAVCapture`.\n\nThis example uses the front-facing camera so we can detect the masks on a user, but you can easily switch it to using the world-facing camera for your task, too. \n\nThere’s quite a lot of code involved in setting up a camera session that’s beyond the scope of this document, but it’s worth reading this guide by Apple for more information on the topic. \n\n\n\n## Processing Inferences \nWhenever a new frame comes in from the camera, we pass it to the Roboflow SDK for inference. \n\nWhenever a new camera frame is received from the hardware, \n\n```\n func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {\n```\n\ngets called. The frame is then passed to the Roboflow SDK, and inferences returned:\n\n\n## Displaying Bounding Boxes \nShowing bounding boxes around the objects that have been detected by your ML model can be useful in showing your user context-relevant information. \n\nWhen an inference is made by the Roboflow SDK, it returns the information that’s needed to display a bounding box. This is done in this example in the `drawBoundingBoxesFrom(detections: [RFObjectDetectionPrediction])` function. The information for where to display the bounding box, and the confidence level of the inference, is extracted here and displayed to the user. \n\n\n## Uploading an Image to Your Model’s Dataset \nIf you want to add additional images to your dataset so that you can improve it with later training, you can do that through the SDK. This will allow you to improve your model through getting new data from the real world when users are using your app.  \n\nWhen the \"Upload Incorrect Image\" button is pressed, the current camera frame is converted to a `UIImage, and uploaded to your dataset. \n\n    func upload(image: UIImage) {\n        let project = \"mask-wearing\"\n        \n        rf.uploadImage(image: image, project: project) { result in\n        ...\n        }\n    }\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboflow%2Froboflow-ios-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froboflow%2Froboflow-ios-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboflow%2Froboflow-ios-starter/lists"}