Skip to content

Commit

Permalink
funding
Browse files Browse the repository at this point in the history
  • Loading branch information
faithoflifedev committed Aug 28, 2024
1 parent 8a3e1d2 commit 86a1d83
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 35 deletions.
9 changes: 9 additions & 0 deletions packages/google_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.3.0+3

* funding

## 1.3.0+2

* dependency bump
* parent project

## 1.3.0+1

* less debug output
Expand Down
4 changes: 3 additions & 1 deletion packages/google_vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Native [Dart](https://dart.dev/) package that integrates Google Vision features,

[![Build Status](https://github.com/faithoflifedev/google_vision/workflows/Dart/badge.svg)](https://github.com/faithoflifedev/google_vision/actions) [![github last commit](https://shields.io/github/last-commit/faithoflifedev/google_vision)](https://shields.io/github/last-commit/faithoflifedev/google_vision) [![github build](https://img.shields.io/github/actions/workflow/status/faithoflifedev/google_vision_workspace/dart.yaml?branch=main)](https://shields.io/github/workflow/status/faithoflifedev/google_vision/Dart) [![github issues](https://shields.io/github/issues/faithoflifedev/google_vision)](https://shields.io/github/issues/faithoflifedev/google_vision)

[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/guidelines/download-assets-1.svg)](https://www.buymeacoffee.com/faithoflif2)

Please feel free to submit PRs for any additional helper methods, or report an [issue](https://github.com/faithoflifedev/google_vision/issues) for a missing helper method and I'll add it if I have time available.

## Recent Changes
Expand All @@ -49,7 +51,7 @@ To use this package, add the dependency to your `pubspec.yaml` file:
```yaml
dependencies:
...
google_vision: ^1.3.0+1
google_vision: ^1.3.0+3
```
### Obtaining Authentication/Authorization Credentials
Expand Down
31 changes: 16 additions & 15 deletions packages/google_vision/example/document_text_detection_file.dart
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
import 'package:google_vision/google_vision.dart';
import 'package:universal_io/io.dart';

void main() async {
final googleVision =
await GoogleVision.withJwtFile('service_credentials.json');

print('checking...');

const int page = 1;

final annotateFileResponses = await googleVision.file.documentTextDetection(
InputConfig.fromFilePath('sample_image/allswell.pdf'),
pages: [1],
pages: [page],
);

String text = '';

for (var annotateFileResponse in annotateFileResponses) {
if (annotateFileResponse.error != null) {
print('error');
} else {
print('pages: ${annotateFileResponse.totalPages}');
}
print('page: $page of ${annotateFileResponse.totalPages}');

for (var annotateImageResponse in annotateFileResponse.responses!) {
annotateImageResponse.fullTextAnnotation!.pages.first.blocks
?.forEach((block) {
block.paragraphs?.forEach((paragraph) {
paragraph.words?.forEach((word) {
var segment = word.symbols?.map((e) => e.text).join();
for (var annotateImageResponse in annotateFileResponse.responses!) {
annotateImageResponse.fullTextAnnotation!.pages.first.blocks
?.forEach((block) {
block.paragraphs?.forEach((paragraph) {
stdout.write('\n');

text += (segment ?? '') + ' ';
paragraph.words?.forEach((word) {
var segment = word.symbols?.map((e) => e.text).join();

stdout.write('${segment ?? ''} ');
});
});
});
});
}
}
}

print(text);
}
2 changes: 1 addition & 1 deletion packages/google_vision/example/face_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ void main() async {
// final googleVision =
// await GoogleVision.withJwtFile('service_credentials.json');

final googleVision = await GoogleVision.withApiKey(
final googleVision = GoogleVision.withApiKey(
Platform.environment['GOOGLE_VISION_API_KEY'] ?? '[YOUR API KEY]',
// additionalHeaders: {'com.xxx.xxx': 'X-Ios-Bundle-Identifier'},
);
Expand Down
1 change: 1 addition & 0 deletions packages/google_vision/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ dependencies:
pcanvas: ^1.1.0
google_vision:
path: ../
universal_io: ^2.2.2
7 changes: 0 additions & 7 deletions packages/google_vision/example/web_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,4 @@ void main() async {
);

print(annotatedResponses);

// for (var webDetection
// in annotatedResponses.responses.first.webDetection.webEntities) {
// print(webDetection.description);

// print(webDetection.boundingPoly!.vertices);
// }
}
2 changes: 1 addition & 1 deletion packages/google_vision/lib/meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ library meta;
import 'dart:convert' show json;

final pubSpec = json.decode(
'{"name":"google_vision","version":"1.3.0+1","homepage":"https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision","environment":{"sdk":">=3.2.0 <4.0.0"},"description":"Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications.","dependencies":{"args":"^2.5.0","collection":"^1.18.0","crypto_keys_plus":"^0.4.0","dio":"^5.6.0","http":"^1.2.2","image":"^4.1.7","jose_plus":"^0.4.6","json_annotation":"^4.9.0","loggy":"^2.0.3","mime":"^1.0.5","retrofit":"^4.2.0","universal_io":"^2.2.2"},"dev_dependencies":{"build_runner":"^2.4.11","grinder":"^0.9.5","json_serializable":"^6.8.0","lints":"^4.0.0","publish_tools":"^1.0.0+4","retrofit_generator":"^8.2.0"},"executables":{"vision":""},"repository":"https://github.com/faithoflifedev/google_vision"}');
'{"name":"google_vision","version":"1.3.0+3","homepage":"https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision","environment":{"sdk":">=3.2.0 <4.0.0"},"description":"Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications.","dependencies":{"args":"^2.5.0","collection":"^1.18.0","crypto_keys_plus":"^0.4.0","dio":"^5.6.0","http":"^1.2.2","image":"^4.1.7","jose_plus":"^0.4.6","json_annotation":"^4.9.0","loggy":"^2.0.3","mime":"^1.0.6","retrofit":"^4.2.0","universal_io":"^2.2.2"},"dev_dependencies":{"build_runner":"^2.4.11","grinder":"^0.9.5","json_serializable":"^6.8.0","lints":"^4.0.0","publish_tools":"^1.0.0+4","retrofit_generator":"^8.2.0"},"executables":{"vision":""},"repository":"https://github.com/faithoflifedev/google_vision","funding":["https://www.buymeacoffee.com/faithoflif2"]}');
12 changes: 8 additions & 4 deletions packages/google_vision/lib/src/google_vision_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ class GoogleVision with UiLoggy {
}

@Deprecated('Use [GoogleVisionImage.annotate] instead.')
Future<AnnotatedResponses> annotate(
{required AnnotateImageRequests requests}) async {
final batchAnnotateImagesResponse =
await image.annotate(requests: requests.requests);
Future<AnnotatedResponses> annotate({
required AnnotateImageRequests requests,
String? parent,
}) async {
final batchAnnotateImagesResponse = await image.annotate(
requests: requests.requests,
parent: parent,
);

return AnnotatedResponses(responses: batchAnnotateImagesResponse.responses);
}
Expand Down
8 changes: 5 additions & 3 deletions packages/google_vision/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: google_vision
description: Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications.
version: 1.3.0+1
version: 1.3.0+3
repository: https://github.com/faithoflifedev/google_vision
homepage: https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision

funding:
- https://www.buymeacoffee.com/faithoflif2

environment:
sdk: ">=3.2.0 <4.0.0"

Expand All @@ -17,7 +20,7 @@ dependencies:
jose_plus: ^0.4.6
json_annotation: ^4.9.0
loggy: ^2.0.3
mime: ^1.0.5
mime: ^1.0.6
retrofit: ^4.2.0
universal_io: ^2.2.2

Expand All @@ -26,7 +29,6 @@ dev_dependencies:
grinder: ^0.9.5
json_serializable: ^6.8.0
lints: ^4.0.0
# melos: ^6.0.0
publish_tools: ^1.0.0+4
retrofit_generator: ^8.2.0

Expand Down
2 changes: 2 additions & 0 deletions packages/google_vision/tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Native [Dart](https://dart.dev/) package that integrates Google Vision features,

[![Build Status](https://github.com/faithoflifedev/google_vision/workflows/Dart/badge.svg)](https://github.com/faithoflifedev/google_vision/actions) [![github last commit](https://shields.io/github/last-commit/faithoflifedev/google_vision)](https://shields.io/github/last-commit/faithoflifedev/google_vision) [![github build](https://img.shields.io/github/actions/workflow/status/faithoflifedev/google_vision_workspace/dart.yaml?branch=main)](https://shields.io/github/workflow/status/faithoflifedev/google_vision/Dart) [![github issues](https://shields.io/github/issues/faithoflifedev/google_vision)](https://shields.io/github/issues/faithoflifedev/google_vision)

[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/guidelines/download-assets-1.svg)](https://www.buymeacoffee.com/faithoflif2)

Please feel free to submit PRs for any additional helper methods, or report an [issue](https://github.com/faithoflifedev/google_vision/issues) for a missing helper method and I'll add it if I have time available.

## Recent Changes
Expand Down
4 changes: 4 additions & 0 deletions packages/google_vision_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.3.0+3

* funding

## 1.3.0+2

* removed FutureBuilder nesting
Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To use this package, add the dependency to your `pubspec.yaml` file:
```yaml
dependencies:
...
google_vision_flutter: ^1.3.0+2
google_vision_flutter: ^1.3.0+3
```
Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision_flutter/lib/meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ library meta;
import 'dart:convert' show json;

final pubSpec = json.decode(
'{"name":"google_vision_flutter","version":"1.3.0+2","homepage":"https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision_flutter","environment":{"sdk":">=3.2.0 <4.0.0","flutter":">=3.16.0"},"description":"Add Google Visions image labeling, face, logo, and landmark detection into your Flutter applications.","dependencies":{"flutter_image_converter":"^0.3.3","google_vision":"^1.3.0+2","flutter":{"sdk":"flutter"}},"dev_dependencies":{"flutter_lints":"^4.0.0","grinder":"^0.9.5","publish_tools":"^1.0.0+4"},"repository":"https://github.com/faithoflifedev/google_vision"}');
'{"name":"google_vision_flutter","version":"1.3.0+3","homepage":"https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision_flutter","environment":{"sdk":">=3.2.0 <4.0.0","flutter":">=3.16.0"},"description":"Add Google Visions image labeling, face, logo, and landmark detection into your Flutter applications.","dependencies":{"flutter_image_converter":"^0.3.3","google_vision":"^1.3.0+2","flutter":{"sdk":"flutter"}},"dev_dependencies":{"flutter_lints":"^4.0.0","grinder":"^0.9.5","publish_tools":"^1.0.0+4"},"repository":"https://github.com/faithoflifedev/google_vision","funding":["https://www.buymeacoffee.com/faithoflif2"]}');
2 changes: 1 addition & 1 deletion packages/google_vision_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: google_vision_flutter
description: Add Google Visions image labeling, face, logo, and landmark detection into your Flutter applications.
version: 1.3.0+2
version: 1.3.0+3
repository: https://github.com/faithoflifedev/google_vision
homepage: https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision_flutter

Expand Down

0 comments on commit 86a1d83

Please sign in to comment.