brianmtully / flutter_google_ml_vision

Flutter Plugin for Google ML Kit Vision
BSD 3-Clause "New" or "Revised" License
47 stars 49 forks source link

ML Vision dependencies #9

Open shliama opened 3 years ago

shliama commented 3 years ago

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?

brianmtully commented 3 years ago

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

shliama commented 3 years ago

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

festapp86 commented 3 years ago

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 commented 3 years ago

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

shliama commented 3 years ago

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.

festapp86 commented 3 years ago

@brianmtully we would highly appreciate a timeline. Thanks

swissonid commented 3 years ago

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 ?

AhmedMahhmoud commented 3 years ago

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 !