是否可以在 Xcode playground 中使用 Core ML 模型?

Is it possible to use Core ML models in Xcode playground?

现在我正在开发使用 CoreML 模型来检测某些数据概率的应用程序。

但我想知道是否可以在 Xcode playground 中使用 CoreML 模型,因为这样更便于测试。

我尝试将模型添加到 Xcode 9 playground 但没有成功。

为 Core ML 模型自动生成 Swift(或 ObjC)类 是一个额外的构建步骤,因此它需要一个完整的 Xcode 项目。 (在操场上得到它会很棒 feature request to send to Apple。)

在操场上应该仍然可以将模型作为捆绑资源加载并使用更通用的 MLModel API 对其进行评估。或者将生成的 Swift 模型代码从项目复制粘贴到 playground。