The initializer options to crop and scale an image when you create an image feature value.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
Framework
- Core ML
Declaration
struct ImageOption
The initializer options to crop and scale an image when you create an image feature value.
SDKs
Framework
struct ImageOption
static let crop And Scale: MLFeature Value .Image Option
The option you use to crop and scale an image when creating an image feature value.
static let crop Rect: MLFeature Value .Image Option
The option you use to crop an image when creating an image feature value.
init(String)
Creates an image feature option with the given string.
init(raw Value: String)
Creates an image feature option with the given raw-value string.
init(cg Image: CGImage, pixels Wide: Int, pixels High: Int, pixel Format Type: OSType, options: [MLFeature Value .Image Option : Any]?)
Wraps an image as a value for a feature, given an image, its width, and its height, in pixels.
init(cg Image: CGImage, constraint: MLImage Constraint, options: [MLFeature Value .Image Option : Any]?)
Wraps an image as a value for a feature, given an image and its constraints.
init(image At: URL, pixels Wide: Int, pixels High: Int, pixel Format Type: OSType, options: [MLFeature Value .Image Option : Any]?)
Wraps an image as a value for a feature, given an image’s URL, and its width and height, in pixels.
init(image At: URL, constraint: MLImage Constraint, options: [MLFeature Value .Image Option : Any]?)
Wraps an image as a value for a feature, given an image’s URL and constraints.
class MLImage Constraint
The width, height, and pixel format constraints of an image feature.