testing library

Test support for code that uses core_ml.

Replace CoreMLBindings.instance with bindings backed by fake CoreMLHostApi and CoreMLPlatformApi implementations to exercise the Dart API without a device.

Classes

BatchPredictionRequestMessage
BatchPredictionResultMessage
ComputeDeviceMessage
Mirrors a case of MLComputeDevice.
CoreMLBindings
The platform APIs the core_ml library talks to.
CoreMLHostApi
Only registered when Core ML's iOS 18 / macOS 15 surface is available.
CoreMLPlatformApi
Always available, on every OS version.
DictionaryConstraintMessage
Mirrors MLDictionaryConstraint.
DictionaryValueMessage
An MLFeatureValue holding a dictionary. Exactly one map is set.
DoubleValueMessage
An MLFeatureValue holding a double.
EncodedImageMessage
An image input given as encoded bytes or a file path. The native side decodes it and resizes it to the feature's MLImageConstraint unless width, height or pixelFormatType override it.
FeatureDescriptionMessage
Mirrors MLFeatureDescription.
FeatureMapMessage
A named set of feature values, so nested maps stay off the wire.
FeatureValueMessage
Any MLFeatureValue.
ImageConstraintMessage
Mirrors MLImageConstraint and its MLImageSizeConstraint.
ImageSizeMessage
A width/height pair from MLImageSize.
Int64ValueMessage
An MLFeatureValue holding an int64.
ModelConfigurationMessage
Mirrors MLModelConfiguration.
ModelDescriptionMessage
Mirrors MLModelDescription.
ModelInfoMessage
A loaded MLModel.
ModelMetadataMessage
The metadata dictionary of an MLModelDescription.
MultiArrayConstraintMessage
Mirrors MLMultiArrayConstraint and its MLMultiArrayShapeConstraint.
MultiArrayMessage
An MLMultiArray, transferred by value as raw storage bytes.
PixelBufferMessage
A CVPixelBuffer image feature, transferred by value.
PixelBufferPlaneMessage
One plane of a PixelBufferMessage.
PredictionRequestMessage
PredictionResultMessage
SequenceConstraintMessage
Mirrors MLSequenceConstraint.
SequenceValueMessage
An MLSequence. Exactly one list is set.
ShapeMessage
One multi-array shape, so nested lists stay off the wire.
StateConstraintMessage
Mirrors MLStateConstraint.
StringValueMessage
An MLFeatureValue holding a string.
UndefinedValueMessage
An undefined MLFeatureValue of a given type, used for optional inputs.

Enums

ComputeDeviceKindMessage
Which case of MLComputeDevice a device is.
ComputeUnitsMessage
Mirrors MLComputeUnits.
FeatureTypeMessage
Mirrors MLFeatureType. The order matches the public Dart enum.
ImageEncodingMessage
Encoded image formats for pixel-buffer export.
ImageSizeConstraintTypeMessage
Mirrors MLImageSizeConstraintType.
MultiArrayDataTypeMessage
Mirrors MLMultiArrayDataType. The order matches the public Dart enum.
ReshapeFrequencyMessage
Mirrors MLOptimizationHints.ReshapeFrequency.
ShapeConstraintTypeMessage
Mirrors MLMultiArrayShapeConstraintType.
SpecializationStrategyMessage
Mirrors MLOptimizationHints.SpecializationStrategy.