flutter_google_ml_vision icon indicating copy to clipboard operation
flutter_google_ml_vision copied to clipboard

ML Vision dependencies

Open shliama opened this issue 4 years ago • 8 comments

Hey, thanks for the plugin 🙌

I have a question regarding the Android & iOS dependencies, in the firebase_ml_vision plugin we had to manually specify whatever we want to use in either build.gradle or Podfile.

Here, I see these dependencies specified inside android/build.gradle:

implementation 'com.google.mlkit:face-detection:16.0.6'
implementation 'com.google.mlkit:barcode-scanning:16.1.1'
implementation 'com.google.mlkit:image-labeling:17.0.3'
implementation 'com.google.mlkit:object-detection:16.2.3'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'
implementation 'com.google.mlkit:language-id:16.1.1'

And these inside ios/google_ml_vision.podspec:

s.dependency 'GoogleMLKit/BarcodeScanning'
s.dependency 'GoogleMLKit/FaceDetection'
s.dependency 'GoogleMLKit/ImageLabeling'
s.dependency 'GoogleMLKit/TextRecognition'

Does it mean all these binaries are being packaged inside iOS/Android apps, even if I just want to use only Barcode scanning?

shliama avatar May 14 '21 05:05 shliama

Yes that is correct. I can remove those dependencies to allow you to only use the features you need.

brianmtully avatar May 15 '21 03:05 brianmtully

I think it's a way to go, let me know if you need any help with the changes.

shliama avatar May 15 '21 13:05 shliama

Yes, we also would only need TextDetection. The final binary apk file is quite big if all dependencies are being packaged. Do you have a rough timeline, when this is available? Thanks

festapp86 avatar May 22 '21 10:05 festapp86

@shliama did you find a way to only compile the libs you actually need?

festapp86 avatar May 28 '21 16:05 festapp86

Not really. I haven't had time to research this yet, but most probably we should look at how it was done with the firebase_ml_vision plugin.

shliama avatar May 29 '21 03:05 shliama

@brianmtully we would highly appreciate a timeline. Thanks

festapp86 avatar Jun 06 '21 14:06 festapp86

Hi, @brianmtully is spent yesterday sketching and implement a possible solution for this problem. The changes are going to be big and I do not know if it allies with your vision of this plugin.

The idea behind it is to split the plugin into multiple packages like the Firebase packages.

What do you think @brianmtully ?

swissonid avatar Jul 07 '21 07:07 swissonid

I am only using face detection splitting it would be good for app size since it is now around 70m with only the detection being used !

AhmedMahhmoud avatar Jul 13 '21 11:07 AhmedMahhmoud