Can I load CoreML models on the fly?

Can I load CoreML models on the fly? If there is a model saved in the phone, can I let my app load it programatically?


Thanks in advance.

Accepted Reply

Yes, you can use the compileModel(at: URL) method of MLModel to compile models on the fly. The compiled model is saved at a temporary location. So if you don't want to compile the model every time (which takes some time), you should copy it to a safer place after compilation.

Replies

Yes, you can use the compileModel(at: URL) method of MLModel to compile models on the fly. The compiled model is saved at a temporary location. So if you don't want to compile the model every time (which takes some time), you should copy it to a safer place after compilation.