coremltools

Use Core ML to integrate machine learning models into your app. Core ML provides a unified representation for all models. Your app uses Core ML APIs and user data to make predictions, and to train or fine-tune models, all on the user’s device.

Core ML optimizes on-device performance by leveraging the CPU, GPU, and Neural Engine while minimizing its memory footprint and power consumption. Running a model strictly on the user’s device removes any need for a network connection, which helps keep the user’s data private and your app responsive.

Caffe is a deep learning framework that is commonly known for its [Model Zoo](https://caffe.berkeleyvision.org/model_zoo.html. The following example shows how to convert a Caffe model (AlexNet) to Core ML format (.mlmodel).

❗️

Caffe Converter is in maintenance mode

Since Caffe is not in active development, new features such as MIL, Custom operators, etc. will not be added to the Caffe converter.

Supporting files:

import coremltools as ct

# Convert a Caffe model to a classifier in Core ML
model = ct.converters.caffe.convert(
    ('bvlc_alexnet.caffemodel', 'deploy.prototxt'),
    predicted_feature_name='class_labels.txt'
)

# Now save the model
model.save('BVLCObjectClassifier.mlmodel')

Updated 5 months ago


Caffe


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.