From 61323c7a8253984b2a6d3ea96cd8d2384ce369a9 Mon Sep 17 00:00:00 2001 From: rjvysakh Date: Wed, 24 Nov 2021 12:16:43 +0530 Subject: [PATCH 1/7] feat: migrated to google ml kit and null safety --- lib/detector_painters.dart | 25 +++-- lib/main.dart | 66 ++++++------ lib/utils.dart | 35 +++---- pubspec.lock | 203 ++++++++++++++++++++++++++++--------- pubspec.yaml | 23 ++--- 5 files changed, 230 insertions(+), 122 deletions(-) diff --git a/lib/detector_painters.dart b/lib/detector_painters.dart index bb59b56..fc7ccf5 100644 --- a/lib/detector_painters.dart +++ b/lib/detector_painters.dart @@ -1,14 +1,17 @@ import 'dart:ui'; -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; +// import 'package:firebase_ml_vision/firebase_ml_vision.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:google_ml_kit/google_ml_kit.dart'; class FaceDetectorPainter extends CustomPainter { FaceDetectorPainter(this.imageSize, this.results); final Size imageSize; - double scaleX, scaleY; - dynamic results; - Face face; + late double scaleX; + + late double scaleY; + late dynamic results; + late Face face; @override void paint(Canvas canvas, Size size) { final Paint paint = Paint() @@ -52,14 +55,14 @@ class FaceDetectorPainter extends CustomPainter { } RRect _scaleRect( - {@required Rect rect, - @required Size imageSize, - @required Size widgetSize, - double scaleX, - double scaleY}) { + {@required Rect? rect, + @required Size? imageSize, + @required Size? widgetSize, + double? scaleX, + double? scaleY}) { return RRect.fromLTRBR( - (widgetSize.width - rect.left.toDouble() * scaleX), - rect.top.toDouble() * scaleY, + (widgetSize!.width - rect!.left.toDouble() * scaleX!), + rect.top.toDouble() * scaleY!, widgetSize.width - rect.right.toDouble() * scaleX, rect.bottom.toDouble() * scaleY, Radius.circular(10)); diff --git a/lib/main.dart b/lib/main.dart index 288b51d..84c0f9e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,9 @@ import 'dart:convert'; import 'dart:io'; +import 'package:google_ml_kit/google_ml_kit.dart'; import 'package:path_provider/path_provider.dart'; import 'package:camera/camera.dart'; -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; +// import 'package:firebase_ml_vision/firebase_ml_vision.dart'; import 'package:flutter/material.dart'; import 'detector_painters.dart'; import 'utils.dart'; @@ -27,16 +28,16 @@ class _MyHomePage extends StatefulWidget { } class _MyHomePageState extends State<_MyHomePage> { - File jsonFile; + File? jsonFile; dynamic _scanResults; - CameraController _camera; + CameraController? _camera; var interpreter; bool _isDetecting = false; CameraLensDirection _direction = CameraLensDirection.front; dynamic data = {}; double threshold = 1.0; - Directory tempDir; - List e1; + Directory? tempDir; + List? e1; bool _faceFound = false; final TextEditingController _name = new TextEditingController(); @override @@ -49,15 +50,18 @@ class _MyHomePageState extends State<_MyHomePage> { } Future loadModel() async { + print("load"); try { final gpuDelegateV2 = tfl.GpuDelegateV2( - options: tfl.GpuDelegateOptionsV2( - false, - tfl.TfLiteGpuInferenceUsage.fastSingleAnswer, - tfl.TfLiteGpuInferencePriority.minLatency, - tfl.TfLiteGpuInferencePriority.auto, - tfl.TfLiteGpuInferencePriority.auto, - )); + options: tfl.GpuDelegateOptionsV2(), + // options: tfl.GpuDelegateOptionsV2( + // false, + // tfl.TfLiteGpuInferenceUsage.fastSingleAnswer, + // tfl.TfLiteGpuInferencePriority.minLatency, + // tfl.TfLiteGpuInferencePriority.auto, + // tfl.TfLiteGpuInferencePriority.auto, + // ), + ); var interpreterOptions = tfl.InterpreterOptions() ..addDelegate(gpuDelegateV2); @@ -72,20 +76,21 @@ class _MyHomePageState extends State<_MyHomePage> { await loadModel(); CameraDescription description = await getCamera(_direction); - ImageRotation rotation = rotationIntToImageRotation( + InputImageRotation rotation = rotationIntToImageRotation( description.sensorOrientation, ); _camera = CameraController(description, ResolutionPreset.low, enableAudio: false); - await _camera.initialize(); + await _camera!.initialize(); await Future.delayed(Duration(milliseconds: 500)); tempDir = await getApplicationDocumentsDirectory(); - String _embPath = tempDir.path + '/emb.json'; + String _embPath = tempDir!.path + '/emb.json'; jsonFile = new File(_embPath); - if (jsonFile.existsSync()) data = json.decode(jsonFile.readAsStringSync()); + if (jsonFile!.existsSync()) + data = json.decode(jsonFile!.readAsStringSync()); - _camera.startImageStream((CameraImage image) { + _camera!.startImageStream((CameraImage image) { if (_camera != null) { if (_isDetecting) return; _isDetecting = true; @@ -123,6 +128,7 @@ class _MyHomePageState extends State<_MyHomePage> { }, ).catchError( (_) { + print("error"); _isDetecting = false; }, ); @@ -131,7 +137,7 @@ class _MyHomePageState extends State<_MyHomePage> { } HandleDetection _getDetectionMethod() { - final faceDetector = FirebaseVision.instance.faceDetector( + final faceDetector = GoogleMlKit.vision.faceDetector( FaceDetectorOptions( mode: FaceDetectorMode.accurate, ), @@ -143,14 +149,14 @@ class _MyHomePageState extends State<_MyHomePage> { const Text noResultsText = const Text(''); if (_scanResults == null || _camera == null || - !_camera.value.isInitialized) { + !_camera!.value.isInitialized) { return noResultsText; } CustomPainter painter; final Size imageSize = Size( - _camera.value.previewSize.height, - _camera.value.previewSize.width, + _camera!.value.previewSize!.height, + _camera!.value.previewSize!.width, ); painter = FaceDetectorPainter(imageSize, _scanResults); return CustomPaint( @@ -159,7 +165,7 @@ class _MyHomePageState extends State<_MyHomePage> { } Widget _buildImage() { - if (_camera == null || !_camera.value.isInitialized) { + if (_camera == null || !_camera!.value.isInitialized) { return Center( child: CircularProgressIndicator(), ); @@ -172,7 +178,7 @@ class _MyHomePageState extends State<_MyHomePage> { : Stack( fit: StackFit.expand, children: [ - CameraPreview(_camera), + CameraPreview(_camera!), _buildResults(), ], ), @@ -185,8 +191,8 @@ class _MyHomePageState extends State<_MyHomePage> { } else { _direction = CameraLensDirection.back; } - await _camera.stopImageStream(); - await _camera.dispose(); + await _camera!.stopImageStream(); + await _camera!.dispose(); setState(() { _camera = null; @@ -254,7 +260,7 @@ class _MyHomePageState extends State<_MyHomePage> { var img = imglib.Image(width, height); // Create Image buffer const int hexFF = 0xFF000000; final int uvyButtonStride = image.planes[1].bytesPerRow; - final int uvPixelStride = image.planes[1].bytesPerPixel; + final int uvPixelStride = image.planes[1].bytesPerPixel!; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { final int uvIndex = @@ -283,11 +289,11 @@ class _MyHomePageState extends State<_MyHomePage> { String _recog(imglib.Image img) { List input = imageToByteListFloat32(img, 112, 128, 128); input = input.reshape([1, 112, 112, 3]); - List output = List(1 * 192).reshape([1, 192]); + List output = List.filled(1 * 192, null, growable: false).reshape([1, 192]); interpreter.run(input, output); output = output.reshape([192]); e1 = List.from(output); - return compare(e1).toUpperCase(); + return compare(e1!).toUpperCase(); } String compare(List currEmb) { @@ -308,7 +314,7 @@ class _MyHomePageState extends State<_MyHomePage> { void _resetFile() { data = {}; - jsonFile.deleteSync(); + jsonFile!.deleteSync(); } void _viewLabels() { @@ -403,7 +409,7 @@ class _MyHomePageState extends State<_MyHomePage> { void _handle(String text) { data[text] = e1; - jsonFile.writeAsStringSync(json.encode(data)); + jsonFile!.writeAsStringSync(json.encode(data)); _initializeCamera(); } } diff --git a/lib/utils.dart b/lib/utils.dart index 893e319..b5ffe12 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -3,10 +3,11 @@ import 'dart:math'; import 'dart:typed_data'; import 'dart:ui'; import 'package:camera/camera.dart'; -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; +// import 'package:firebase_ml_vision/firebase_ml_vision.dart'; +import 'package:google_ml_kit/google_ml_kit.dart'; import 'package:image/image.dart' as imglib; -typedef HandleDetection = Future Function(FirebaseVisionImage image); +typedef HandleDetection = Future Function(InputImage image); enum Choice { view, delete } Future getCamera(CameraLensDirection dir) async { @@ -17,17 +18,17 @@ Future getCamera(CameraLensDirection dir) async { ); } -FirebaseVisionImageMetadata buildMetaData( +InputImageData buildMetaData( CameraImage image, - ImageRotation rotation, + InputImageRotation rotation, ) { - return FirebaseVisionImageMetadata( - rawFormat: image.format.raw, + return InputImageData( + inputImageFormat: InputImageFormat.BGRA8888, size: Size(image.width.toDouble(), image.height.toDouble()), - rotation: rotation, + imageRotation: rotation, planeData: image.planes.map( (Plane plane) { - return FirebaseVisionImagePlaneMetadata( + return InputImagePlaneMetadata( bytesPerRow: plane.bytesPerRow, height: plane.height, width: plane.width, @@ -40,27 +41,27 @@ FirebaseVisionImageMetadata buildMetaData( Future detect( CameraImage image, HandleDetection handleDetection, - ImageRotation rotation, + InputImageRotation rotation, ) async { return handleDetection( - FirebaseVisionImage.fromBytes( - image.planes[0].bytes, - buildMetaData(image, rotation), + InputImage.fromBytes( + bytes: image.planes[0].bytes, + inputImageData: buildMetaData(image, rotation), ), ); } -ImageRotation rotationIntToImageRotation(int rotation) { +InputImageRotation rotationIntToImageRotation(int rotation) { switch (rotation) { case 0: - return ImageRotation.rotation0; + return InputImageRotation.Rotation_0deg; case 90: - return ImageRotation.rotation90; + return InputImageRotation.Rotation_90deg; case 180: - return ImageRotation.rotation180; + return InputImageRotation.Rotation_180deg; default: assert(rotation == 270); - return ImageRotation.rotation270; + return InputImageRotation.Rotation_270deg; } } diff --git a/pubspec.lock b/pubspec.lock index 28bd288..88456bc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,63 +7,84 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" + version: "3.1.6" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.8.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" camera: dependency: "direct main" description: name: camera url: "https://pub.dartlang.org" source: hosted - version: "0.5.8+2" + version: "0.9.4+5" + camera_platform_interface: + dependency: transitive + description: + name: camera_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + camera_web: + dependency: transitive + description: + name: camera_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.3.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.12" - convert: + version: "1.15.0" + cross_file: dependency: transitive description: - name: convert + name: cross_file url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "0.3.2" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "3.0.1" cupertino_icons: dependency: "direct main" description: @@ -71,135 +92,203 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.2.1" - firebase_ml_vision: + version: "6.1.2" + firebase_core: dependency: "direct main" description: - name: firebase_ml_vision + name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.6.0+2" + version: "1.10.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + google_ml_kit: + dependency: "direct main" + description: + name: google_ml_kit + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.3" image: dependency: "direct main" description: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.12" - intl: + version: "3.0.8" + js: dependency: transitive description: - name: intl + name: js url: "https://pub.dartlang.org" source: hosted - version: "0.16.1" + version: "0.6.3" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.7.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.8.0" path_provider: dependency: "direct main" description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.11" + version: "2.0.7" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+1" + version: "2.1.2" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "2.0.3" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.0.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "4.4.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.0.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.0.2" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "3.0.13" + version: "4.2.4" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "3.0.1+1" sky_engine: dependency: transitive description: flutter @@ -211,20 +300,27 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted version: "2.0.0" string_scanner: dependency: transitive @@ -232,56 +328,63 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.15" + version: "0.4.2" tflite_flutter: dependency: "direct main" description: name: tflite_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.9.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.1.0" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.6.1" + version: "5.3.1" sdks: - dart: ">=2.6.0 <3.0.0" - flutter: ">=1.12.13+hotfix.5 <2.0.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8bcd846..7da9ea9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,28 +14,26 @@ description: Realtime face recognition with flutter. version: 1.0.0+1 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: + camera: ^0.9.4+5 + cupertino_icons: ^0.1.2 + firebase_core: ^1.10.0 + # firebase_ml_vision: ^0.12.0+3 flutter: sdk: flutter - camera: ^0.5.8+2 - firebase_ml_vision: ^0.6.0 - path_provider: ^1.6.11 - tflite_flutter: ^0.4.1 - image: ^2.1.12 - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + google_ml_kit: ^0.7.3 + image: ^3.0.8 + path_provider: ^2.0.7 + tflite_flutter: ^0.9.0 dev_dependencies: flutter_test: sdk: flutter - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec - # The following section is specific to Flutter. flutter: @@ -47,13 +45,10 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/mobilefacenet.tflite - # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. - # For details regarding adding assets from package dependencies, see # https://flutter.dev/assets-and-images/#from-packages - # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a From 56c4825013f3ceb93c561ddf42f390a06a9899df Mon Sep 17 00:00:00 2001 From: Vysakh R J <88417155+rjvysakh@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:25:57 +0530 Subject: [PATCH 2/7] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 678ad0e..639f656 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ alt="Face recognition"> # Face Recognition Flutter -Realtime face recognition flutter app. +Realtime face recognition flutter app update with latest null safety implementation and the depreceated Firebase ML Vision has been migrated to Google ML Kit. + +This base repo has been forked from https://github.com/Rajatkalsotra/Face-Recognition-Flutter. [Download](https://github.com/Rajatkalsotra/Face-Recognition-with-Flutter/raw/master/FaceRecognition.apk) apk file. @@ -10,7 +12,7 @@ Realtime face recognition flutter app. ### Face detection -Used Firebase ML Vision to detect faces . +Uses Google ML Kit ### Face Recognition @@ -21,7 +23,7 @@ Convert Tensorflow implementation of [MobileFaceNet](https://github.com/sirius-a **Step 1:** Download or clone this repo: ``` -git clone https://github.com/Rajatkalsotra/Face-Recognition-Flutter.git +git clone https://github.com/rjvysakh/Face-Recognition-Flutter ``` **Step 2:** Go to project root and execute the following command in console to get the required dependencies: From 1a1ef8dae25adc7189983c62064da12e287b605c Mon Sep 17 00:00:00 2001 From: Vysakh R J <88417155+rjvysakh@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:27:53 +0530 Subject: [PATCH 3/7] Create main.yml --- .github/workflows/main.yml | 74 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..def9daa --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,74 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# # Allows you to run this workflow manually from the Actions tab +# workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel + +jobs: + version: + name: Create version number + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 +# - name: Fetch all history for all tags and branches +# run: | +# git fetch --prune --depth=10000 +# - name: Install GitVersion +# uses: gittools/actions/gitversion/setup@v0.9.4 +# with: +# versionSpec: '5.2.x' +# - name: Use GitVersion +# id: gitversion +# uses: gittools/actions/gitversion/execute@v0.9.4 +# - name: Create version.txt with nuGetVersion +# run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > version.txt +# - name: Upload version.txt +# uses: actions/upload-artifact@v2 +# with: +# name: gitversion +# path: version.txt + build: + name: Build APK and Create release + needs: [ version ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1 + with: + flutter-version: '2.5.3' +# - name: Get version.txt +# uses: actions/download-artifact@v2 +# with: +# name: gitversion +# - name: Create new file without newline char from version.txt +# run: tr -d '\n' < version.txt > version1.txt +# - name: Read version +# id: version +# uses: juliangruber/read-file-action@v1 +# with: +# path: version1.txt + - run: flutter pub get +# - run: flutter test + - run: flutter build apk --release --split-per-abi +# - run: flutter build appbundle + - name: Create a Release in GitHub + uses: ncipollo/release-action@v1.8.10 + with: + artifacts: "build/app/outputs/apk/release/*.apk,build/app/outputs/bundle/release/app-release.aab" + token: ${{ secrets.GH_TOKEN }} + tag: v1.0.${{ github.run_number }} + commit: ${{ github.sha }} From 8580bab3fd8d3a40bfe01939b6691b4c38795cb2 Mon Sep 17 00:00:00 2001 From: Vysakh R J <88417155+rjvysakh@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:38:04 +0530 Subject: [PATCH 4/7] Create LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index af1500f..1cdb35a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Rajat Kalsotra +Copyright (c) 2021 Vysakh R J Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From d03b2b97c6e17e6b49ad1428e6cca6e8593a5980 Mon Sep 17 00:00:00 2001 From: Vysakh R J <88417155+rjvysakh@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:40:14 +0530 Subject: [PATCH 5/7] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 639f656..cc70fab 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Realtime face recognition flutter app update with latest null safety implementat This base repo has been forked from https://github.com/Rajatkalsotra/Face-Recognition-Flutter. - [Download](https://github.com/Rajatkalsotra/Face-Recognition-with-Flutter/raw/master/FaceRecognition.apk) apk file. ## Steps From 7515f89c67771b4847825f93c5540458187e0ebc Mon Sep 17 00:00:00 2001 From: Vysakh R J <88417155+rjvysakh@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:43:15 +0530 Subject: [PATCH 6/7] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index def9daa..ff4fbf2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-java@v1 with: - java-version: '12.x' + java-version: '11.x' - uses: subosito/flutter-action@v1 with: flutter-version: '2.5.3' From 1d6425bf596c079ab2bd2882e81d2507053ec2f8 Mon Sep 17 00:00:00 2001 From: Vysakh R J <88417155+rjvysakh@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:58:01 +0530 Subject: [PATCH 7/7] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 1cdb35a..af1500f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Vysakh R J +Copyright (c) 2020 Rajat Kalsotra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal