【问题标题】:TensorFlow-Lite Swift setup (bridge-header/includes/root folder)TensorFlow-Lite Swift 设置(bridge-header/includes/root 文件夹)
【发布时间】:2017-11-17 16:50:33
【问题描述】:

TensorFlow Lite 最近发布了。代码库带有demo ios application

我想创建/运行相同的应用程序,但使用 Swift。我已按照以下步骤操作:

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/g3doc/ios.md#using-in-your-own-application

这还不够。

1) 我认为我现在缺少的是一些桥接头。

2) 我也不确定这些特定的 Obj-C 包含在 swift 中的外观:

#include "tensorflow/contrib/lite/kernels/register.h"
#include "tensorflow/contrib/lite/model.h"
#include "tensorflow/contrib/lite/string_util.h"
#include "tensorflow/contrib/lite/tools/mutable_op_resolver.h"

3) 打包好的ios app必须要包含TensorFlow根目录(200+mb)吗?

【问题讨论】:

    标签: ios tensorflow tensorflow-lite


    【解决方案1】:

    目前,您需要从 Objective-C++ 调用 TFLite C++ API。您可以制作一个精简的 Objective-C++ 类来调用 TFLite,并在 Swift 中使用它。

    未来可能会提供更多语言支持。

    对于问题(3),编译后的库只有几百字节。查看tensorflow/contrib/lite/build_ios_universal_lib.sh 构建的库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-13
      • 2021-11-10
      • 2015-04-20
      • 2018-10-25
      • 1970-01-01
      • 2022-01-17
      • 2019-01-31
      • 1970-01-01
      相关资源
      最近更新 更多