BementBuildingClassifier
@available(OSX 10.14, iOS 12.0, tvOS 12.0, *)
@available(watchOS, unavailable)
class BementBuildingClassifier
Class for model loading and prediction
-
Declaration
Swift
var model: MLModel
-
URL of model assuming it was installed in the same bundle as this class
Declaration
Swift
class var urlOfModelInThisBundle: URL { get }
-
Construct a model with explicit path to mlmodelc file
Declaration
Swift
init(contentsOf url: URL) throws
Parameters
url
the file url of the model
throws
an NSError object that describes the problem
-
Construct a model that automatically loads the model from the app’s bundle
Declaration
Swift
convenience init()
-
Construct a model with configuration
Declaration
Swift
convenience init(configuration: MLModelConfiguration) throws
Parameters
configuration
the desired model configuration
throws
an NSError object that describes the problem
-
Construct a model with explicit path to mlmodelc file and configuration
Declaration
Swift
init(contentsOf url: URL, configuration: MLModelConfiguration) throws
Parameters
url
the file url of the model
configuration
the desired model configuration
throws
an NSError object that describes the problem
-
Make a prediction using the structured interface
Throws
an NSError object that describes the problemDeclaration
Swift
func prediction(input: BementBuildingClassifierInput) throws -> BementBuildingClassifierOutput
Parameters
input
the input to the prediction as BementBuildingClassifierInput
Return Value
the result of the prediction as BementBuildingClassifierOutput
-
Make a prediction using the structured interface
Throws
an NSError object that describes the problemDeclaration
Swift
func prediction(input: BementBuildingClassifierInput, options: MLPredictionOptions) throws -> BementBuildingClassifierOutput
Parameters
input
the input to the prediction as BementBuildingClassifierInput
options
prediction options
Return Value
the result of the prediction as BementBuildingClassifierOutput
-
Make a prediction using the convenience interface
Throws
an NSError object that describes the problemDeclaration
Swift
func prediction(image: CVPixelBuffer) throws -> BementBuildingClassifierOutput
Parameters
image
Input image to be classified as color (kCVPixelFormatType_32BGRA) image buffer, 299 pixels wide by 299 pixels high
Return Value
the result of the prediction as BementBuildingClassifierOutput
-
Make a batch prediction using the structured interface
Throws
an NSError object that describes the problemDeclaration
Swift
func predictions(inputs: [BementBuildingClassifierInput], options: MLPredictionOptions = MLPredictionOptions()) throws -> [BementBuildingClassifierOutput]
Parameters
inputs
the inputs to the prediction as [BementBuildingClassifierInput]
options
prediction options
Return Value
the result of the prediction as [BementBuildingClassifierOutput]