I am little bit confused with this. Now I have .tflite
and label.txt
but right now I want to access TensorFlow lite using Flutter Plugin . In here I am confused with adding tflite
as a dependency in pubspec.yaml
You need provide in assets section:
assets:
- path/to/your/file
To access your asset:
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
And in Asset folder is your .tflite
files which, can be generated your own training, labels, and inferences or from manual copying from a GitHub file as they are specifically generated by TensorFlow image data. See here for more details
Assets folder
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.