GithubHelp home page GithubHelp logo

jaeheee / flutterwithmediapipe Goto Github PK

View Code? Open in Web Editor NEW
163.0 7.0 50.0 33.44 MB

Flutter with MediaPipe ML models

Swift 0.68% Objective-C 0.06% Dart 95.26% Ruby 2.29% Shell 1.70%
flutter mediapipe face-detection face-landmark-detection hand-detection pose-estimation flutter-mediapipe dart real-time

flutterwithmediapipe's Introduction

Gmail Badge CV TECH BLOG LinkedIn

Jaehee Kim

Product Engineer


Hits

Most Used Languages

flutterwithmediapipe's People

Contributors

charlieforward9 avatar jaeheee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutterwithmediapipe's Issues

Why isAndroid use copyRotate and flipHorizontal?

codes below:

if (Platform.isAndroid) {
  image = imageLib.copyRotate(image, angle: -90);
  image = imageLib.flipHorizontal(image);
}
var tensorImage = TensorImage(TensorType.float32);
tensorImage.loadImage(image);
tensorImage = imageProcessor.process(tensorImage);

Issue with Camera Controller

I am running this application on a google pixel 4a.
I am getting these issues for all 4 models of media pipe..

Encountering the following errors:

======== Exception caught by foundation library ====================================================
The following _CastError was thrown while dispatching notifications for CameraController:
Null check operator used on a null value

When the exception was thrown, this was the stack:
#0 _CameraPageState.onNewCameraSelected. (package:flutter_with_mediapipe/pages/camera_page.dart:131:28)
#1 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:243:25)
#2 ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:309:5)
#3 CameraController.initialize. (package:camera/src/camera_controller.dart:267:9)
#11 Where.whereType. (package:stream_transform/src/where.dart:21:30)
...
The CameraController sending notification was: CameraController#a6084(CameraValue(isRecordingVideo: false, isInitialized: true, errorDescription: null, previewSize: Size(720.0, 480.0), isStreamingImages: true, flashMode: FlashMode.auto, exposureMode: ExposureMode.auto, focusMode: FocusMode.auto, exposurePointSupported: true, focusPointSupported: true, deviceOrientation: DeviceOrientation.portraitUp, lockedCaptureOrientation: null, recordingOrientation: null))

Keystore failed

Hello, I downloaded your project and wanted to give it a try, but I got an error because of the sign in function in the build.gradle file. Unfortunately, there is no such keystore file on my computer, so I cannot run the application.

`FAILURE: Build failed with an exception.

Where:
Build file 'D:\Projects\tensorFlow-Flutter-main\tensorFlow-Flutter-main\android\app\build.gradle' line: 57

What went wrong:
A problem occurred evaluating project ':app'.

D:\Projects\tensorFlow-Flutter-main\tensorFlow-Flutter-main\android\keystore\keystore.password (Sistem belirtilen yolu bulam�yor)

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Get more help at https://help.gradle.org/

BU�LD FAILED in 980ms`
fail

I cannot run successfully

I can create a new Flutter project and successfully run it,
But I encountered an error while running this Flutter project, as shown below;
I need help
——————————————————————————————
Launching lib\main.dart on NTN AN20 in debug mode...
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY .
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Task 'assembleDebug' not found in root project 'android'.

  • Try:
    Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 23s
ProcessException: Process exited abnormally with exit code 1:

Welcome to Gradle 7.2!

Here are the highlights of this release:

  • Toolchain support for Scala
  • More cache hits when Java source files have platform-specific line endings
  • More resilient remote HTTP build cache behavior

For more details see https://docs.gradle.org/7.2/release-notes.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

  • What went wrong:
    Project 'app' not found in root project 'android'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s
Command: D:\zlxDownload\FlutterWithMediaPipe-main\android\gradlew.bat app:tasks --all --console=auto

Build Error: ld: framework not found TensorFlowLiteC

I am unable to build the project for iOS. Here are the steps to reproduce the error:

  1. Download the project
  2. run sh install.sh
  3. run flutter pub add get
  4. Open the project in Visual Studio Code
  5. Setup the signing for Xcode
  6. run pod install
  7. run flutter run

This produces the following error:

Ld /Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Intermediates.noindex/Pods.build/Release-iphoneos/tflite_flutter.build/Objects-normal/armv7/Binary/tflite_flutter normal armv7 (in target 'tflite_flutter' from project 'Pods')
    cd /Users/vijeshrao/Downloads/FlutterWithMediaPipe-main\ 2/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target armv7-apple-ios9.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -L/Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Products/Release-iphoneos/tflite_flutter -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift -F/Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Products/Release-iphoneos/tflite_flutter -F/Users/vijeshrao/Documents/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_armv7 -filelist /Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Intermediates.noindex/Pods.build/Release-iphoneos/tflite_flutter.build/Objects-normal/armv7/tflite_flutter.LinkFileList -install_name @rpath/tflite_flutter.framework/tflite_flutter -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Intermediates.noindex/Pods.build/Release-iphoneos/tflite_flutter.build/Objects-normal/armv7/tflite_flutter_lto.o -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Intermediates.noindex/Pods.build/Release-iphoneos/tflite_flutter.build/Objects-normal/armv7/tflite_flutter.swiftmodule -all_load -lc++ -framework TensorFlowLiteC -framework Flutter -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Intermediates.noindex/Pods.build/Release-iphoneos/tflite_flutter.build/Objects-normal/armv7/tflite_flutter_dependency_info.dat -o /Users/vijeshrao/Library/Developer/Xcode/DerivedData/Runner-hggazerwaeetoqeyyebckgveptau/Build/Intermediates.noindex/Pods.build/Release-iphoneos/tflite_flutter.build/Objects-normal/armv7/Binary/tflite_flutter

ld: framework not found TensorFlowLiteC
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can I solve this issue? Please let me know.

Thank you in advance..!

Build Error on Android Device: keystore.password (No such file or directory)

Hi,

On macos developing environment with an Android device, I did:

  1. sh install.sh
  2. flutter pub get
  3. flutter run

But received error like this:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/*path*/FlutterWithMediaPipe/android/app/build.gradle' line: 57

* What went wrong:
A problem occurred evaluating project ':app'.
> /Users/*path*/FlutterWithMediaPipe/android/keystore/keystore.password (No such file or directory)

FaceDetector stuck if multiple faces present

Thank you for this repository!
Face Detector works fine when there is one face present, but when there are 2 or more Non maximum supression algorithm gets stuck in infinite while loop. It doesn't filter out non-intersecting boxes properly.
I have slightly modified your code in non_maximum_supression.dart to

var picks = <int>[];
  while (I.isNotEmpty) {
    var ind0 = positions.sublist(positions.length - 1, positions.length);
    var ind1 = positions.sublist(0, positions.length - 1);

    var xx1 = _maximum(_itemIndex(_x1, ind0)[0], _itemIndex(_x1, ind1));
    var yy1 = _maximum(_itemIndex(_y1, ind0)[0], _itemIndex(_y1, ind1));
    var xx2 = _minimum(_itemIndex(_x2, ind0)[0], _itemIndex(_x2, ind1));
    var yy2 = _minimum(_itemIndex(_y2, ind0)[0], _itemIndex(_y2, ind1));
    var w = _maximum(0.0, xx2 - xx1);
    var h = _maximum(0.0, yy2 - yy1);
    var inter = w * h;
    var o = inter /
        (_sum(_itemIndex(area, ind0)[0], _itemIndex(area, ind1)) - inter);

    picks.add(ind0[0]);

    List<double> newI = [];
    List<int> newPositions = [];
    o.asMap().forEach((key, value) {
      if (value <= threshold) {
        newI.add(I[key]);
        newPositions.add(positions[key]);
      }
    });

    I = newI;
    positions = newPositions;
  }

  List<Detection> results = [];

  for (var pick in picks) {
    results.add(detections[pick]);
  }
  return results;

and also in face_detection_service.dart


    for (var detection in detections) {
      Rect? bbox;
      final score = detection.score;
      if (score > threshold) {
        bbox = Rect.fromLTRB(
          inputImage.width * detection.xMin,
          inputImage.height * detection.yMin,
          inputImage.width * detection.width,
          inputImage.height * detection.height,
        );

        bbox = _imageProcessor.inverseTransformRect(
            bbox, image.height, image.width);
      }
      rectFaces.add({'bbox': bbox, 'score': score});
    }
    rectFaces.sort((a, b) => b['score'].compareTo(a['score']));

    return rectFaces;

It detects and returns multiple boxes for each face present. I hope it helps, thanks again for this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.