Create a model for use with VNRecognizedObjectObservation

Hi,


I can't find any documentation on how to train a model for use with VNRecognizedObjectObservation.
If you look at ObjectDetector.mlmodel, it's type is: Pipeline
Where standard Inception models types are: Image Classifier
For Object detection, I'm guessing I need to create a Pipeline, but can't find any documentation for it....


Are there any other constructors I can use other than:


let datasource: CreateML.MLImageClassifier.DataSource = .labeledDirectories(at: root)
let classifier = try MLImageClassifier(trainingData: datasource)
try classifier.write(to: modelURL)


for example:

let datasource: CreateML.MLPipelineClassifier.DataSource = .labeledDirectories(at: root, withOther: data)
let classifier = try MLPipelineClassifier(trainingData: datasource)
try classifier.write(to: modelURL)


Kind Regards
Chris

Replies

Hi,


It sounds like you are referring to the ObjectDetector.mlmodel from the Vision “Recognizing Objects in Live Capture” sample code. That model was created using Turi Create 4.3.2. Please refer to Object Detection to learn how to generate your own models using Turi Create.

Is not it possible creating VNRecognizedObjectObservation compatible mlmodel with MLImageClassifier right now.

Did you find a way doing it with CreateML framework ?

You cannot do this with Create ML right now. You can use Turi Create, or use some other training tool like Keras (but you have to be very careful to create a Core ML model that is exactly right, i.e. exactly what Turi Create would have produced).

Thanks for confirmation.