是否可以通过 wifi 上传 .ml 模型文件而不是嵌入它们?

Is it possible to upload .mlmodel files over wifi insetad of having them embedded?

我打算使用一些大小超过 500MB 的模型,我不希望将它们嵌入,否则我的应用程序会很大,这并不是真正理想的。

谢谢,

这是可能的。下载模型后,compile 使用:

let compiledUrl = try MLModel.compileModel(at: modelUrl)
let model = try MLModel(contentsOf: compiledUrl)

编译后的模型将存储在一个临时位置。编译完成后,您应该将其移动到永久位置。