From fc388873f974f25fc0cfc02cbcbc6fafe9e1e7bd Mon Sep 17 00:00:00 2001 From: Abdelaziz Mahdy Date: Thu, 19 Dec 2024 11:23:47 -0400 Subject: [PATCH] general fixes and adding pub ignore --- .pubignore | 1 + CHANGELOG.md | 3 +++ .../lib/run_model_by_image_picker_camera_demo.dart | 1 - example/pubspec.yaml | 1 + lib/image_utils_isolate.dart | 9 --------- lib/pytorch_lite.dart | 13 +------------ pubspec.yaml | 2 +- 7 files changed, 7 insertions(+), 23 deletions(-) create mode 100644 .pubignore diff --git a/.pubignore b/.pubignore new file mode 100644 index 0000000..62f8347 --- /dev/null +++ b/.pubignore @@ -0,0 +1 @@ +example/assets/* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6424a2d..594c5d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.3.1 + +- Removed example models from version published to pub ## 4.3.0 - Updated Pigeon to v22.4.2 diff --git a/example/lib/run_model_by_image_picker_camera_demo.dart b/example/lib/run_model_by_image_picker_camera_demo.dart index 52df5ec..f91366e 100644 --- a/example/lib/run_model_by_image_picker_camera_demo.dart +++ b/example/lib/run_model_by_image_picker_camera_demo.dart @@ -3,7 +3,6 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; import 'package:pytorch_lite/pytorch_lite.dart'; -import 'package:pytorch_lite_example/ui/box_widget.dart'; class RunModelByImagePickerCameraDemo extends StatefulWidget { const RunModelByImagePickerCameraDemo({Key? key}) : super(key: key); diff --git a/example/pubspec.yaml b/example/pubspec.yaml index a4cf403..19a7983 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -51,6 +51,7 @@ dev_dependencies: # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. + flutter_driver: any flutter: # The following line ensures that the Material Icons font is diff --git a/lib/image_utils_isolate.dart b/lib/image_utils_isolate.dart index 5af1df2..e8964d6 100644 --- a/lib/image_utils_isolate.dart +++ b/lib/image_utils_isolate.dart @@ -67,15 +67,6 @@ class ImageUtilsIsolate { return null; } - Uint8List _rotateImageBytes(Uint8List imageBytes, int rotation) { - Image? image = decodeImage(imageBytes); - if (image == null) { - throw Exception("Unable to decode image bytes"); - } - - Image rotatedImage = copyRotate(image, angle: rotation); - return Uint8List.fromList(encodeJpg(rotatedImage)); - } static List _getParamsBasedOnType(CameraImage cameraImage, {int? rotation}) { diff --git a/lib/pytorch_lite.dart b/lib/pytorch_lite.dart index c9d2586..8b1ab2d 100644 --- a/lib/pytorch_lite.dart +++ b/lib/pytorch_lite.dart @@ -11,7 +11,6 @@ import 'package:pytorch_lite/enums/model_type.dart'; import 'package:pytorch_lite/image_utils_isolate.dart'; import 'package:pytorch_lite/pigeon.dart'; import 'package:collection/collection.dart'; -import 'package:image/image.dart' as img; export 'enums/dtype.dart'; export 'package:pytorch_lite/pigeon.dart'; @@ -125,16 +124,6 @@ Future> _getLabelsTxt(String labelPath) async { return labelsData.split("\n"); } -Uint8List _rotateImageBytes(Uint8List imageBytes, int rotation) { - img.Image? image = img.decodeImage(imageBytes); - if (image == null) { - throw Exception("Unable to decode image bytes"); - } - - img.Image rotatedImage = img.copyRotate(image, angle: rotation); - return Uint8List.fromList(img.encodeJpg(rotatedImage)); -} - /* class CustomModel { final int _index; @@ -735,7 +724,7 @@ class ModelObjectDetection { ], ), ); - }).toList() + }) ], ); }); diff --git a/pubspec.yaml b/pubspec.yaml index 79997b8..bb34a18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pytorch_lite description: Flutter package to help run pytorch lite models classification and yolov5 and yolov8 -version: 4.3.0 +version: 4.3.1 homepage: https://github.com/abdelaziz-mahdy/pytorch_lite environment: