Export your model to mobile

Custom Vision Service allows classifiers to be exported to run offline. You can embed your exported classifier into an application and run it locally on a device for real-time classification. Currently the supported are export to Tensorflow for Android devices or the CoreML format for iOS11.

Custom Vision Service only exports “compact” domains. The models generated by compact domains are optimized for the constraints of real-time classification on mobile devices. Classifiers built with a compact domain may be slightly less accurate a standard domain with the same amount of training data. The tradeoff is that they are small enough to be run locally in near real time. For general tips on improving your classifiers, see Getting Started: Improving your classifier.

Convert your project to a “compact” domain

If you are starting from scratch to build a new classifier, see Getting Started: Build a Classifier. However, when choosing a domain for your classifier, you must select a compact domain.

Select a compact domain.

If you have an existing classifier, you need to convert it to a compact domain. To convert the domain of an existing classifier:

  1. Open the project you want to convert to a compact domain. You can find a list of your projects at https://customvision.ai/projects.
  2. Open the settings page for this classifier by clicking on the gear-shaped icon at the top right. From within the setting page, select a compact domain and then hit Save Changes.
  3. After changing your domain, you will need to hit the Train button to train your project.

    Change settings to a compact domain.

Export your model

Once your project has finished training, you can export your model. To do so:

  1. Go to the Performance tab and select the iteration you want to export (probably your most recent iteration.)
  2. If this iteration used a compact domain, an export button appears at the top bar.
  3. Click on export, then select your format.
  4. Click on export and then download to download your model.

    Export project.

Next Steps

A sample of how to use your exported CoreML model in an iOS application for real-time image classification is available in Swift, as is an example iOS application for using your exported CoreML model with Xamarin. A sample of how to use your exported Tensorflow model in an Android application for real-time image classification is also available.