【发布时间】:2020-12-08 16:34:12
【问题描述】:
我们正在尝试在我们的 iOS 应用中使用 TensorFlow Face Mesh 模型。型号详情:https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view.
我按照 TS 官方教程设置模型:https://firebase.google.com/docs/ml-kit/ios/use-custom-models 并且还使用教程中的 Python 脚本打印了模型 Input-Output 并得到了这个:
INPUT
[ 1 192 192 3]
<class 'numpy.float32'>
OUTPUT
[ 1 1 1 1404]
<class 'numpy.float32'>
此时,我很难理解这些数字的含义,以及如何使用模型Interpreter 传递输入图像并获取输出面部网格点。到目前为止,这是我的 Swift 代码:
let coreMLDelegate = CoreMLDelegate()
var interpreter: Interpreter
// Core ML delegate will only be created for devices with Neural Engine
if coreMLDelegate != nil {
interpreter = try Interpreter(modelPath: modelPath,
delegates: [coreMLDelegate!])
} else {
interpreter = try Interpreter(modelPath: modelPath)
}
任何帮助将不胜感激!
【问题讨论】:
标签: swift tensorflow tensorflow2.0 coreml coremltools