Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Package? #3922

Open
charlieforward9 opened this issue Dec 13, 2022 · 12 comments
Open

Flutter Package? #3922

charlieforward9 opened this issue Dec 13, 2022 · 12 comments
Assignees
Labels
platform:android Issues with Android as Platform platform:ios MediaPipe IOS issues stat:awaiting googler Waiting for Google Engineer's Response task::all All tasks of MediaPipe type:feature Enhancement in the New Functionality or Request for a New Solution

Comments

@charlieforward9
Copy link

charlieforward9 commented Dec 13, 2022

Hello, just learned about MediaPipe today! It's amazing how many developer resources are open-source. It's also crazy to realize that Google has empowered so much of it. With that being said, I was surprised to see the MediaPipe team has not created a package for Flutter developers since both were founded by Google and the MediaPipe is marketed as cross-platform

System information

  • MediaPipe Solution: All solutions available on iOS and Android
  • Programming language: Dart
  • Are you willing to contribute it: Yes, but my team cannot prioritize this over other tasks.

Will this change the current API?

No. Creating a Flutter package will extend and merge the iOS/Android API such that the new, extended API can be used natively in the Dart language. Nothing about the current API will need to be changed as far as I am concerned.

Who will benefit with this feature?

  • Developers and teams using the Flutter framework.
  • Developers who want to build application to multiple platforms with one codebase
  • Developers who want to do great things with great Google products
  • Myself 🫶🏼
@charlieforward9 charlieforward9 added the type:feature Enhancement in the New Functionality or Request for a New Solution label Dec 13, 2022
@charlieforward9 charlieforward9 changed the title Flutter Support? Flutter Package? Dec 13, 2022
@kuaashish kuaashish self-assigned this Dec 13, 2022
@kuaashish kuaashish added task::all All tasks of MediaPipe platform:android Issues with Android as Platform platform:ios MediaPipe IOS issues labels Dec 13, 2022
@kuaashish
Copy link
Collaborator

Hi @charlieforward9,
Thanks for raising this feature request. This looks like an interesting request. We will discuss this feature internally and prioritize it among others.

@kuaashish kuaashish assigned hadon and unassigned kuaashish Dec 13, 2022
@kuaashish kuaashish added the stat:awaiting googler Waiting for Google Engineer's Response label Dec 13, 2022
@szotp-lc
Copy link

I have integrated mediapipe into my flutter app but it was really cumbersome. It would be great at least have C api that can be called directly from dart, instead of channel communication separate for each platform.

There is https://github.com/homuler/MediaPipeUnityPlugin/tree/master/mediapipe_api, originally created for Unity but could be repurposed. The problem is - it's not pure C, so generating ffi bindings is not so straightforward, and it is not official.

@charlieforward9
Copy link
Author

charlieforward9 commented Dec 13, 2022

@szotp-lc

It would be great at least have C api that can be called directly from dart, instead of channel communication separate for each platform.

If it were done this way, would it work on all the mobile and desktop platforms that Flutter supports? If so, then the only separate implementation would be the web? Asking to learn. Thanks

@szotp-lc
Copy link

@charlieforward9 Correct.

@schmidt-sebastian
Copy link
Collaborator

Hi! We are having some discussion about this, but cannot provide a timeline at this point. We certainly recognize that better Flutter support is very important to large part of our community. We will provide updates if and when we can.

@schmidt-sebastian schmidt-sebastian removed the stat:awaiting googler Waiting for Google Engineer's Response label Dec 14, 2022
@charlieforward9
Copy link
Author

@schmidt-sebastian Thank you for the response. Please do keep us updated in this thread, there seem to be a few who tagged along with interest based on the emoji response.

@charlieforward9
Copy link
Author

@szotp-lc do you mind emailing me at charlesrichardsonusa@gmail.com, I would appreciate hearing more about how you integrated into your Flutter app (unless you didn't mind keeping the conversation in this thread). Thank you!

@szotp-lc
Copy link

szotp-lc commented Dec 15, 2022

Honestly I would recommend waiting for official support or using a different library (like ML Kit). It has been a painful process.

@charlieforward9
Copy link
Author

charlieforward9 commented Jun 26, 2023

Honestly I would recommend waiting for official support or using a different library (like ML Kit).

Official Support > .tflite embedding > MLKit MethodChannel

I built a PoseDetection MethodChannel for iOS using MLKit to compare it with my existing pose_detection_full.tflite file embedding using flutter-tflite. The MethodChannel inference delivered slower than the .tflite file embedding with my implementation.

I am sharing this to show findings, save other people time, and keep this relevant.

Goal


Actual (Embedded .tflite)

RPReplay_Final1687755288.mov

Actual (iOS MLKit Method Channel)

RPReplay_Final1687757878.mov

My implementation uses Dart Isolates to keep the model processing off of the main thread.

@charlieforward9
Copy link
Author

charlieforward9 commented Sep 2, 2023

Thanks to Google and their Mediapipe team, we are now able to witness development of flutter-mediapipe. It's great to follow along and see how Google would build a package from the ground up.

I have become a watcher of the repository to get a firsthand sight of the progress and changes, so if anyone else lands here and is interested in the progress of the package. I recommend doing the same.

@rukinish
Copy link

so as of now is it possible to have a mobile application that is developed using flutter that has mediapipe ?

@charlieforward9
Copy link
Author

Yes, there is just a lot of manual setup. I recommend using this sample repo to help get started with it.

I didn't need Android config and I am actually moving to native Swift now for better performance. If you manage to get it up and running with all updated dependencies, feel free to create a PR to Open Source it.. I am waiting for the original creator @JaeHeee to merge it, so we can keep my fork current till it merges.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:android Issues with Android as Platform platform:ios MediaPipe IOS issues stat:awaiting googler Waiting for Google Engineer's Response task::all All tasks of MediaPipe type:feature Enhancement in the New Functionality or Request for a New Solution
Projects
None yet
Development

No branches or pull requests

7 participants