Adds a MediaPipe implementation that talks directly to C++ via FFI. (Technically, indirectly and through a C intermediary, but still fairly directly in comparison to method channels.)
C bridge code uses Dart's native FFI functionality and ffigen to automatically generate the required bindings from C headers pulled from the MediaPipe repository.
TODOs
Note: This is a feature / release branch, which means only fully reviewed changes are able to land here via their own PRs.
Copy the resulting libtext_classifier.dylib file (found in the bazel-out directory) to this repository at the packages/mediapipe-task-text/examples/assets directory.
Note: This will move up a level to mediapipe-task-text/assets after google/flutter-mediapipe#9.
Summary
Adds a MediaPipe implementation that talks directly to C++ via FFI. (Technically, indirectly and through a C intermediary, but still fairly directly in comparison to method channels.)
C bridge code uses Dart's native FFI functionality and
ffigen
to automatically generate the required bindings from C headers pulled from the MediaPipe repository.TODOs
mediapipe_core
package (google/flutter-mediapipe#11)mediapipe_text
package (google/flutter-mediapipe#12)mediapipe_vision
package (google/flutter-mediapipe#13)TESTING
To run this PR locally, complete the following steps (on macOS):
google/mediapipe
with the latest internal changes pulled down, run this build command:libtext_classifier.dylib
file (found in thebazel-out
directory) to this repository at thepackages/mediapipe-task-text/examples/assets
directory.Download
bert_classifier.tflite
and place it in the same directory.Run the example app and click the floating action button to classify text.