Skip to content

Commit

Permalink
general fixes and adding pub ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelaziz-mahdy committed Dec 19, 2024
1 parent 8ac54cd commit fc38887
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 23 deletions.
1 change: 1 addition & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
example/assets/*
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 4.3.1

- Removed example models from version published to pub
## 4.3.0

- Updated Pigeon to v22.4.2
Expand Down
1 change: 0 additions & 1 deletion example/lib/run_model_by_image_picker_camera_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions lib/image_utils_isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<dynamic> _getParamsBasedOnType(CameraImage cameraImage,
{int? rotation}) {
Expand Down
13 changes: 1 addition & 12 deletions lib/pytorch_lite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -125,16 +124,6 @@ Future<List<String>> _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;
Expand Down Expand Up @@ -735,7 +724,7 @@ class ModelObjectDetection {
],
),
);
}).toList()
})
],
);
});
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit fc38887

Please sign in to comment.