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

OpenCV dependencies not included #9

Open
andydean565 opened this issue Oct 23, 2020 · 11 comments
Open

OpenCV dependencies not included #9

andydean565 opened this issue Oct 23, 2020 · 11 comments

Comments

@andydean565
Copy link

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.

@flutter-clutter
Copy link
Owner

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.

@andydean565
Copy link
Author

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

@andydean565
Copy link
Author

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

@flutter-clutter
Copy link
Owner

flutter-clutter commented Nov 9, 2020

@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.

@andydean565
Copy link
Author

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

@flutter-clutter
Copy link
Owner

I see. And does it run on an iOS device now as well?

@andydean565
Copy link
Author

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

@KorbinianMossandl
Copy link

@flutter-clutter
using git LFS will not work:
dart-lang/pub#1433

@KorbinianMossandl
Copy link

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

@andydean565
Copy link
Author

I didn't think to recompile OpenCV, any advice on how to do that?

I assume you would :

  1. clone the OpenCV repo
  2. comment out the module imports not needed in some file (no sure which one)
  3. compile to IOS
  4. copy the built file into this project

@KorbinianMossandl
Copy link

@andydean565 yes, thats what you need to do.
here is an issue that talks a bit more about it:
opencv/opencv#13439

But i would have no idea what modules we exactly need and which not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants