The document discusses Core ML, which allows machine learning models to be run directly on a device. Core ML takes models trained by other frameworks and converts them to a format that can be used by iOS, watchOS, and tvOS apps. This enables features like image recognition, text prediction, and natural language processing directly on the device without needing an internet connection. Core ML uses input types like CVPixelBuffer for images and outputs predictions as labels with confidence values. Vision and Core ML can be used together for real-time machine learning tasks like image recognition from the camera. Core ML Tools is an open source library for converting models to the Core ML format.
5. 6
Task
Real Time Image Recognition
Text Prediction
Sentiment Analysis
Machine Translation
Face Detection
Emotion Detection
Personalization Search Prediction
Music Tagging
Natural Language Processing
Speaker Identi?cation
Handwriting Recognition
67. 68
import coremltools
# Convert a ca?e model to a classi?er in Core ML
coreml_model = coremltools.converters.ca?e.convert(('bvlc_alexnet.ca?emodel',
¡®deploy.prototxt'),
predicted_feature_name='class_labels.txt')
# Now save the model
coreml_model.save('BVLCObjectClassi?er.mlmodel')
68. 69
import coremltools
# Convert a ca?e model to a classi?er in Core ML
coreml_model = coremltools.converters.ca?e.convert(('bvlc_alexnet.ca?emodel',
¡®deploy.prototxt'),
predicted_feature_name='class_labels.txt')
# Now save the model
coreml_model.save('BVLCObjectClassi?er.mlmodel')
69. 70
import coremltools
# Convert a ca?e model to a classi?er in Core ML
coreml_model = coremltools.converters.ca?e.convert(('bvlc_alexnet.ca?emodel',
¡®deploy.prototxt'),
predicted_feature_name='class_labels.txt')
# Now save the model
coreml_model.save('BVLCObjectClassi?er.mlmodel')
70. 71
import coremltools
# Convert a ca?e model to a classi?er in Core ML
coreml_model = coremltools.converters.ca?e.convert(('bvlc_alexnet.ca?emodel',
¡®deploy.prototxt'),
predicted_feature_name='class_labels.txt')
# Now save the model
coreml_model.save('BVLCObjectClassi?er.mlmodel')