flutter-simple-edge-detection
flutter-simple-edge-detection copied to clipboard
OpenCV dependencies not included
I can see from your documentation that you need to include the OpenCV dependencies manually and am wondering the reasons why?
I plan on extending the package slightly and including it in a project but leaving out the OpenCV dependencies would require me to have the project stored locally.
Hey @andydean565. The dependencies are very huge. The OpenCV Framework for iOS is more than 1 GB. Git did not let me push such a huge file. If you find a way to do it, feel free to create a PR. Originally I wanted to publish this as a Flutter package on pub.dev but this circumstance prevented me from doing it. Also, there is a package size limit of (if I remember correctly) 100 MB on pub.dev.
hey @flutter-clutter
cheers had a look into it and I think you're referring to the "opencv2" file in the ios framework which is 441mb on my end and the Github limit is 100mb, if I find a way around it ill create a PR currently looking into git-lfs
probably will only be able to include the dependencies it on GitHub but at least it could be included in the pubspec straight from Github
I can confirm 'git-lfs' does work to upload the OpenCV dependencies but when trying to push to the fork I get this error
can not upload new objects to public fork
I did create a new repo and pushed to test this method and it worked to include all OpenCV files including the large file, unsure how to get around the error to include a pull request on this project
@andydean565 I was able to to push the dependencies via git-lfs to the branch "add-opencv". However, if I create a new Flutter project and add the dependency like this:
simple_edge_detection:
git:
url: git://github.com/flutter-clutter/flutter-simple-edge-detection
ref: add-opencv
I get an error. Do you have the same issue?
The error tells me that certain files are missing, but I can see they are there.
I did have this issue with some of the files, mostly the ones in the 'jniLibs' folder which are over 50mb and will give a warning but wouldn't stop you from uploading to GitHub so removed them from the '.gitattributes'
I only added the one over 100mb which was causing it not to upload at all, have linked my file below.
https://github.com/andydean565/flutter-simple-edge-detection/blob/master/.gitattributes
it's not an ideal solution but have been able to include it in another project and it works
I see. And does it run on an iOS device now as well?
I have no means of testing on IOS at the moment but can attempt to do so after the UK lockdown as my work does have a mac & iPhone
@flutter-clutter using git LFS will not work: https://github.com/dart-lang/pub/issues/1433
what you could try to do is recompile openCV iOS with only the needed parts and see if you can get the file size down that way
I didn't think to recompile OpenCV, any advice on how to do that?
I assume you would :
- clone the OpenCV repo
- comment out the module imports not needed in some file (no sure which one)
- compile to IOS
- copy the built file into this project
@andydean565 yes, thats what you need to do. here is an issue that talks a bit more about it: https://github.com/opencv/opencv/issues/13439
But i would have no idea what modules we exactly need and which not.