Coder Social home page Coder Social logo

Comments (24)

skvark avatar skvark commented on July 19, 2024 7

The builds are now up in PyPI: https://pypi.python.org/pypi/opencv-contrib-python

Release notes: https://github.com/skvark/opencv-python/releases/tag/7

Remember to uninstall opencv-python before installing opencv-contrib-python because the packages use same namespace. Same rule applies if you change from opencv-contrib-python to opencv-python.

from opencv-python.

skvark avatar skvark commented on July 19, 2024 5

It's coming when I or someone else implements it. Probably later this month.

from opencv-python.

skvark avatar skvark commented on July 19, 2024 4

I have now made most of the changes to enable the contrib builds. Windows builds seem to be fine. However, there's at least one issue related to build times. Travis terminates OS X builds (don't know yet about the Linux builds, still compiling at the moment) at 50 min which is the limit for open source builds. So, builds times require some optimizations before I can make this happen.

from opencv-python.

skvark avatar skvark commented on July 19, 2024 2

Thanks. This means that a new package entry has to be created to PyPI to keep the opencv_contrib separated from the plain opencv package. After this we will have two entries in PyPI:

  • opencv-python, which will remain the same
  • opencv-contrib-python, which will have the contrib modules and a note about the usage in commercial applications

How this will be done in practice is still open. There are few options:

  1. Make a separate repository for opencv_contrib
    • this would duplicate most of the code which is not very practical
  2. Run both builds via this repo, with and without opencv_contrib
    • needs some parameters to the build matrix to decide which build to run

Option 2 is probably the best. Opencv_contrib can be added as a submodule to this repo, and after that it should be pretty easy to parameterize the builds and add new entries to the build matrices. Build times will be of course very long 😃

from opencv-python.

Skylion007 avatar Skylion007 commented on July 19, 2024 1

From reading that email exchange, it just seems you cannot use them commercially, but you should be able to redistribute them. Additionally, the validity of software patents at all very significantly from country to country so as long as you give the option of not having them included, it should be fine.

from opencv-python.

chikiuso avatar chikiuso commented on July 19, 2024 1

opencv-python is an excellent project, I am looking forward to the new branch "opencv-contrib-python" on pypi.

from opencv-python.

skvark avatar skvark commented on July 19, 2024 1

Good news. I had a better look into the build time issue and it turned out that there was a bug in build-wheels.sh file. The script looped through available Python installations and ended up compiling OpenCV multiple times in some cases (related to different unicode width's in Python 2.7). I'm going to do some cleaning and testing before merging the changes into master, but if everything goes as expected, the opencv-contrib-python package should be available pretty soon in PyPI.

from opencv-python.

skvark avatar skvark commented on July 19, 2024

As far as I can understand, some of the opencv_contrib algorithms are non-free/patented and I'm not sure if I can redistribute OpenCV if I add them to the package. More information is needed about opencv_contrib licenses and redistribution rules before any decision can be made.

from opencv-python.

codeskyblue avatar codeskyblue commented on July 19, 2024

the opencv_contrib released with license BSD. looks well for now.

from opencv-python.

codeskyblue avatar codeskyblue commented on July 19, 2024

from opencv-python.

codeskyblue avatar codeskyblue commented on July 19, 2024

looks like they do not like it published.

from opencv-python.

codeskyblue avatar codeskyblue commented on July 19, 2024

Seems have to use opencv2.4 if I want to use SIFT feature.

from opencv-python.

chikiuso avatar chikiuso commented on July 19, 2024

Hi Skvark, is the new entry on Pypi "opencv-contrib-python" coming soon? :)

from opencv-python.

rockywhisper avatar rockywhisper commented on July 19, 2024

Glad to know that. "opencv-contrib-python" is meaningful to many of us.

from opencv-python.

skvark avatar skvark commented on July 19, 2024

Some of the Linux builds have the same problem as above. I did run one of them with ninja-build but it took still over 50 minutes. All build speed optimization tips for Travis are welcome.

from opencv-python.

Skylion007 avatar Skylion007 commented on July 19, 2024

@skvark I have no experience with Travis, but have you considered trying to get Travis to parrallelize the build process? Just looking around, it appears that each TravisVM has 1.5 cores so you might be able to significantly increase the speed by setting the environment variables properly.

env:
  global:
    - MAKEFLAGS="-j 2"

Apparently, Ninja can use too much memory on Travis-CI causing the SWAP space to be used. Limiting the number of parrallel jobs Ninja can do it does apparently speed things up according to other repos.

from opencv-python.

skvark avatar skvark commented on July 19, 2024

Linux builds use -j5 and OS X -j4. I tested them with -j2 too but it had no effect. I will try how it goes when ninja is forced to -j2.

from opencv-python.

codeskyblue avatar codeskyblue commented on July 19, 2024

Is it possible to upload to pypi manualy at present?

from opencv-python.

codeskyblue avatar codeskyblue commented on July 19, 2024

Is any progress, @skvark

from opencv-python.

skvark avatar skvark commented on July 19, 2024

You can follow the progress in https://github.com/skvark/opencv-python/tree/opencv_contrib. Please don't spam to this thread, it will not have any effect to the development process.

from opencv-python.

olalonde avatar olalonde commented on July 19, 2024

@skvark have you considered caching intermediary build artifacts? It might help to speed up builds if used properly.

from opencv-python.

skvark avatar skvark commented on July 19, 2024

Do you mean like pip cache? I managed somehow to get a single macOS build to compile in 31 minutes by adding some OpenCV build flags and -j8, but I don't believe those changes alone made the build faster. Maybe there has been come changes in the Travis macOS environment... Still, some Linux builds take too long. I'll have to see if there are some OpenCV build flags which can be disabled to boost the compilation speed.

from opencv-python.

olalonde avatar olalonde commented on July 19, 2024

Do you mean like pip cache?

No, I was more thinking of object files for example. You can cache an arbitrary directory in travis: https://docs.travis-ci.com/user/caching/#Arbitrary-directories

from opencv-python.

skvark avatar skvark commented on July 19, 2024

Yes, that would indeed make the build faster since the build changes only when the OpenCV version is updated. I'll have to see if that can be done easily for example by caching the whole cmake generated build directory.

from opencv-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.