From e5de45f1527a66ccea1f36795b07570434f2fab0 Mon Sep 17 00:00:00 2001 From: Amish Garg Date: Wed, 1 Jul 2020 22:56:06 +0530 Subject: [PATCH 1/2] prepare for release v0.1.0 --- .gitignore | 2 +- example/image_classification/lib/classifier_quant.dart | 2 +- example/image_classification/test/widget_test.dart | 5 ----- example/pubspec.lock | 5 +++++ lib/src/common/ops/normailze_op.dart | 1 - lib/src/common/tensor_operator.dart | 1 - lib/src/image/image_conversions.dart | 2 -- lib/src/tensorbuffer/tensorbufferfloat.dart | 5 +---- lib/src/tensorbuffer/tensorbufferuint8.dart | 2 -- pubspec.lock | 4 ++-- pubspec.yaml | 9 +++++---- 11 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 example/pubspec.lock diff --git a/.gitignore b/.gitignore index bb431f0..7d0c21c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. -#.vscode/ +.vscode/ # Flutter/Dart/Pub related **/doc/api/ diff --git a/example/image_classification/lib/classifier_quant.dart b/example/image_classification/lib/classifier_quant.dart index 36fc09e..1965cbd 100644 --- a/example/image_classification/lib/classifier_quant.dart +++ b/example/image_classification/lib/classifier_quant.dart @@ -1,5 +1,5 @@ import 'package:imageclassification/classifier.dart'; -import 'package:tflite_flutter_helper/src/common/ops/normailze_op.dart'; +import 'package:tflite_flutter_helper/tflite_flutter_helper.dart'; class ClassifierQuant extends Classifier { ClassifierQuant({int numThreads: 1}) : super(numThreads: numThreads); diff --git a/example/image_classification/test/widget_test.dart b/example/image_classification/test/widget_test.dart index bf70877..570e0e4 100644 --- a/example/image_classification/test/widget_test.dart +++ b/example/image_classification/test/widget_test.dart @@ -5,9 +5,4 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:imageclassification/main.dart'; - void main() {} diff --git a/example/pubspec.lock b/example/pubspec.lock new file mode 100644 index 0000000..3ce0787 --- /dev/null +++ b/example/pubspec.lock @@ -0,0 +1,5 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: {} +sdks: + dart: ">=2.1.0 <3.0.0" diff --git a/lib/src/common/ops/normailze_op.dart b/lib/src/common/ops/normailze_op.dart index 75abebb..9afeca3 100644 --- a/lib/src/common/ops/normailze_op.dart +++ b/lib/src/common/ops/normailze_op.dart @@ -2,7 +2,6 @@ import 'package:tflite_flutter/tflite_flutter.dart'; import 'package:tflite_flutter_helper/src/common/support_preconditions.dart'; import 'package:tflite_flutter_helper/src/common/tensor_operator.dart'; import 'package:tflite_flutter_helper/src/tensorbuffer/tensorbuffer.dart'; -import 'package:tflite_flutter_helper/src/tensorbuffer/tensorbufferfloat.dart'; /// Normalizes a [TensorBuffer] with given mean and stddev: output = (input - mean) / stddev. class NormalizeOp implements TensorOperator { diff --git a/lib/src/common/tensor_operator.dart b/lib/src/common/tensor_operator.dart index 82fa28e..88d3041 100644 --- a/lib/src/common/tensor_operator.dart +++ b/lib/src/common/tensor_operator.dart @@ -1,5 +1,4 @@ import 'package:tflite_flutter_helper/src/common/operator.dart'; -import 'package:tflite_flutter_helper/src/common/sequential_processor.dart'; import 'package:tflite_flutter_helper/src/tensorbuffer/tensorbuffer.dart'; /// Applies some operation on TensorBuffers. diff --git a/lib/src/image/image_conversions.dart b/lib/src/image/image_conversions.dart index 90b6463..dec71ec 100644 --- a/lib/src/image/image_conversions.dart +++ b/lib/src/image/image_conversions.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:image/image.dart'; import 'package:tflite_flutter/tflite_flutter.dart'; import 'package:tflite_flutter_helper/src/image/tensor_image.dart'; diff --git a/lib/src/tensorbuffer/tensorbufferfloat.dart b/lib/src/tensorbuffer/tensorbufferfloat.dart index 02c106c..c0d7f93 100644 --- a/lib/src/tensorbuffer/tensorbufferfloat.dart +++ b/lib/src/tensorbuffer/tensorbufferfloat.dart @@ -1,6 +1,3 @@ -import 'dart:typed_data'; - -import 'package:tflite_flutter/src/bindings/types.dart'; import 'package:tflite_flutter/tflite_flutter.dart'; import 'package:tflite_flutter_helper/src/common/support_preconditions.dart'; @@ -8,7 +5,7 @@ import 'tensorbuffer.dart'; /// Represents data buffer with float(double) values. class TensorBufferFloat extends TensorBuffer { - static final TfLiteType DATA_TYPE = TfLiteType.float32; + static const TfLiteType DATA_TYPE = TfLiteType.float32; /// Creates a [TensorBufferFloat] with specified [shape]. /// diff --git a/lib/src/tensorbuffer/tensorbufferuint8.dart b/lib/src/tensorbuffer/tensorbufferuint8.dart index 3c53fdb..eb2ec22 100644 --- a/lib/src/tensorbuffer/tensorbufferuint8.dart +++ b/lib/src/tensorbuffer/tensorbufferuint8.dart @@ -1,5 +1,3 @@ -import 'dart:ffi'; -import 'dart:typed_data'; import 'dart:math'; import 'package:tflite_flutter/tflite_flutter.dart'; diff --git a/pubspec.lock b/pubspec.lock index 29b5eee..5c8dbfa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -103,7 +103,7 @@ packages: source: hosted version: "0.12.6" meta: - dependency: transitive + dependency: "direct main" description: name: meta url: "https://pub.dartlang.org" @@ -173,7 +173,7 @@ packages: source: hosted version: "3.0.13" quiver: - dependency: transitive + dependency: "direct main" description: name: quiver url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 34faa1a..a99bf7a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,7 @@ name: tflite_flutter_helper -description: Easy processing and manipulating input and output of TensorFlow Lite Models. +description: Easy, fast processing and manipulation input and output of TensorFlow Lite Models. version: 0.1.0 -author: Amish Garg -homepage: +homepage: https://www.github.com/am15h/tflite_flutter_helper environment: sdk: ">=2.6.0 <3.0.0" @@ -10,8 +9,10 @@ environment: dependencies: flutter: sdk: flutter + meta: ^1.1.8 + quiver: ^2.1.3 - path_provider: + path_provider: ^1.6.11 tflite_flutter: ^0.4.1 image: ^2.1.4 From 237d4cdc0e8e36e7c4f86aacfded979038852335 Mon Sep 17 00:00:00 2001 From: Amish Garg Date: Wed, 1 Jul 2020 23:36:23 +0530 Subject: [PATCH 2/2] Update flutter version --- .github/workflows/flutter_drive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_drive.yml b/.github/workflows/flutter_drive.yml index eb61337..1508423 100644 --- a/.github/workflows/flutter_drive.yml +++ b/.github/workflows/flutter_drive.yml @@ -23,7 +23,7 @@ jobs: java-version: '8.x' - uses: subosito/flutter-action@v1 with: - flutter-version: '1.12.13+hotfix.5' + flutter-version: '1.17.4' channel: 'stable' - name: run tests timeout-minutes: 30 @@ -37,4 +37,4 @@ jobs: profile: ${{ matrix.device }} script: | cd ./example/image_classification && flutter pub get - cd ./example/image_classification && flutter driver --driver='test_driver/image_classification_e2e_test.dart' test/image_classification_e2e.dart \ No newline at end of file + cd ./example/image_classification && flutter driver --driver='test_driver/image_classification_e2e_test.dart' test/image_classification_e2e.dart