【发布时间】:2019-07-15 05:47:36
【问题描述】:
我对此有点困惑。现在我有 .tflite 和 label.txt 但现在我想使用 Flutter Plugin 访问 TensorFlow lite。
在这里,我对在 pubspec.yaml 中添加 tflite 作为依赖项感到困惑
【问题讨论】:
标签: android flutter tensorflow-lite
我对此有点困惑。现在我有 .tflite 和 label.txt 但现在我想使用 Flutter Plugin 访问 TensorFlow lite。
在这里,我对在 pubspec.yaml 中添加 tflite 作为依赖项感到困惑
【问题讨论】:
标签: android flutter tensorflow-lite
您需要在资产部分提供:
assets:
- path/to/your/file
要访问您的资产:
import 'dart:async' show Future;
import 'package:flutter/services.dart' show rootBundle;
Future<String> loadAsset() async {
return await rootBundle.loadString('path/to/your/file');
}
【讨论】:
Pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
camera: 0.4.0
tflite: 1.0.4
在 Asset 文件夹中是您的 .tflite 文件,这些文件可以生成您自己的训练、标签和推理,也可以从 GitHub 文件手动复制生成,因为它们是由 TensorFlow 图像数据专门生成的。 See here for more details
资产文件夹
【讨论】: