MachineLearning - Kelmatou/iOSTools GitHub Wiki

:warning: API only available on iOS 11.0 and Later :warning:

Inits

  • init(_ model: MLModel)

Methods

  • func detect(in image: UIImage, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void)

Statics

  • func detectModel(in image: UIImage, model: MLModel, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void)
  • func detectObject(in image: UIImage, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void)
  • func detectPlaces(in image: UIImage, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void)

Definitions

  • init(_ model: MLModel): Create a ImageVision object with a model. Any further call to detect(in:maxResult:completion) will reuse this model.

  • func detect(in image: UIImage, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void): Start a detection on image using model provided at init(model:). You can specify the maximum number of result found with maxResult. When detection is done, an array of result (String, Float) is returned, containing the label of object recognized and the accuracy of the prediction in percentage. An error can also be returned as a GenericError type. See GenericError

  • static func detectModel(in image: UIImage, model: MLModel, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void): Start a detection on image using model. You can specify the maximum number of result found with maxResult. When detection is done, an array of result (String, Float) is returned, containing the label of object recognized and the accuracy of the prediction in percentage. An error can also be returned as a GenericError type. See GenericError

  • static func detectObject(in image: UIImage, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void): Start a detection on image using an internal model that detects different objects (It is using a MobileNet model). You can specify the maximum number of result found with maxResult. When detection is done, an array of result (String, Float) is returned, containing the label of object recognized and the accuracy of the prediction in percentage. An error can also be returned as a GenericError type. See GenericError

  • static func detectPlaces(in image: UIImage, maxResult: Int? = nil, completion: @escaping ([(String, Float)]?, GenericError?) -> Void): Start a detection on image using an internal model that detects type of places (It is using a GoogLeNetPlaces model). You can specify the maximum number of result found with maxResult. When detection is done, an array of result (String, Float) is returned, containing the label of object recognized and the accuracy of the prediction in percentage. An error can also be returned as a GenericError type. See GenericError