Code Monkey home page Code Monkey logo

watson-visual-recognition-ios's Introduction

WARNING: This repository is no longer maintained โš ๏ธ

This repository will not be updated. The repository will be kept available in read-only mode.

Create an iOS app that uses built-in and custom Watson Visual Recognition classifiers

**Note: This pattern has now been deprecated because it uses Watson Visual Recognition which is discontinued. Existing instances are supported until 1 December 2021, but as of 7 January 2021, you can't create instances. Any instance that is provisioned on 1 December 2021 will be deleted. Please view the Maximo Visual Inspection as a way to get started with image classification. Another alternative to train computer vision models is Cloud Annotations.

This is an iOS application that showcases various out of the box classifier available with the Watson Visual Recognition service on IBM Cloud.

This app has support for the following features of Watson Visual Recognition:

  • General: Watson Visual Recognition's default classification, it will return the confidence of an image from thousands of classes.
  • Explicit: Returns percent confidence of whether an image is inappropriate for general use.
  • Food: A classifier intended for images of food items.
  • Custom classifier(s): Gives the user the ability to create their own classifier.
General Food Explicit Custom
๐Ÿ™ƒ ๐Ÿšซ

Architecture

Architecture

Flow

  1. User opens up the app in iOS based mobile phone and chooses the different classifiers (faces, explicit, food etc.) they want to use, including custom classifiers.
  2. The Visual Recognition service on IBM Cloud classifies and provides the app with the classification results.

Prerequisites

Note: ๐Ÿ’ก You can use the free/lite tier of IBM Cloud to use this code!

(Optional) If you want to build your own custom classifier, you can follow along this pattern, this video, or this tutorial.

Steps

  1. Clone the repo
  2. Install dependencies with Carthage
  3. Setup Visual Recognition credentials
  4. Run the app with Xcode

1. Clone the repo

git clone the repo and cd into it by running the following command:

git clone github.com/IBM/watson-visual-recognition-ios.git &&
cd watson-visual-recognition-ios

2. Install dependencies with Carthage

Then run the following command to build the dependencies and frameworks:

carthage update --platform iOS

Tip: ๐Ÿ’ก This step could take some time, please be patient.

3. Create IBM Cloud services

Create the following services:

Copy the API Key from the credentials and add it to Credentials.plist

Credentials

<key>apiKey</key>
<string>YOUR_API_KEY</string>

4. Run the app with Xcode

Launch Xcode using the terminal:

open "Watson Vision.xcodeproj"

Test the application in the simulator

To run in the simulator, select an iOS device from the dropdown and click the โ–บ button.

Xcode build and run

You should now be able to drag and drop pictures into the photo gallery and select these photos from the app.

Tip: ๐Ÿ’ก Custom classifiers will appear in the slider based on the classifier name.

Run the app on an iOS device

Since the simulator does not have access to a camera, and the app relies on the camera to test the classifier, we should run it on a real device.

To do this, we need to sign the application, the first step here is to authenticate with your Apple ID, to do so:

  1. Switch to the General tab in the project editor (The blue icon on the top left).

  2. Under the Signing section, click Add Account.

    Add account

  3. Login with your Apple ID and password.

Now we have to create a certificate to sign our app, in the same General tab do the following:

  1. Still in the General tab of the project editor, change the bundle identifier to com.<YOUR_LAST_NAME>.Core-ML-Vision.

    Build Identifier

  2. Select the personal team that was just created from the Team dropdown.

  3. Plug in your iOS device.

  4. Select your device from the device menu to the right of the build and run icon.

  5. Click build and run.

  6. On your device, you should see the app appear as an installed appear.

  7. When you try to run the app the first time, it will prompt you to approve the developer.

  8. In your iOS settings navigate to General > Device Management.

  9. Tap your email, tap trust.

  10. Now you're ready to use the app!

Demo

Using the simulator Using the camera

License

This code pattern is licensed under the Apache License, Version 2. Separate third-party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.

Apache License FAQ

watson-visual-recognition-ios's People

Contributors

bourdakos1 avatar stevemart avatar horeaporutiu avatar sanjeevghimire avatar stevemar avatar imgbotapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.