bgslibrary icon indicating copy to clipboard operation
bgslibrary copied to clipboard

AttributeError: module 'pybgs' has no attribute 'DPAdaptiveMedian'

Open acxyle opened this issue 6 years ago • 4 comments

Hi there, I need some help.

When I tried to run the demo2.py, it reported an AttributeError: module 'pybgs' has no attribute 'DPAdaptiveMedian', then I annotated that line and ran again, same error happened but for the following line: AttributeError: module 'pybgs' has no attribute 'DPGrimsonGMM'

demo2_1

However, if I removed the whole if is_cv2() or is_cv3() section, the program could be executed successfully

demo2_4

demo2_2

PC config.: Windows 10, Anaconda environment, Pycharm 2019.2.1, Visual studio 16 2019, OpenCV 3.4.2

I followed the https://github.com/andrewssobral/bgslibrary/wiki/Wrapper:-Python to install the pybgs whereas the installation details were slightly different, First I cloned this repository and added OpenCV_DIR system path, Next cmake ... BGS_PYTHON_SUPPORT=ON ... failed, So I wnet back to Building Python wrapper from scratch then used python setup.py build and python setup.py install as a result I saw the: -- The C compiler ... ... -- Configuring done -- Generating done -- Build files have been written to: ...

Therefore I utilized VS 16 2019 to build the bgslibrary.sln in .\bgslibrary\build\temp.win-amd64-3.7\Release, which generated a file named pybgs.cp37-win_amd64.pyd

Based on this .pyd file I can smoothly run demo.py and demo2.py (removed a part), but the installation procedure and partial file names were not exactly the same as the tutorial, in addition the error "AttributeError: module 'pybgs' has no attribute 'DPAdaptiveMedian'".

I hope to know how to fix that.

Sincerely,

acxyle avatar Oct 23 '19 08:10 acxyle

Hi @Acxyle , Thanks for reporting this issue. I will take a look on it. Best

andrewssobral avatar Oct 23 '19 19:10 andrewssobral

Hi @andrewssobral ,

Thanks, and I found something interesting.

config

As you can see, there's 19 items in the config file of this bgslibrary I just cloned (the right-hand side of the image). On the contrary, the other config file which I obtained from a previous version of the same but aged 'libbgs' containing 43 files, it seems containing all modules existing in your document.

I have tried to replace those two config file, even rebuild the .pyd file, however it didn't work. Those things confused me as a newbie.

Waiting for some guidances.

acxyle avatar Oct 25 '19 09:10 acxyle

Hi there, I need some help.

When I tried to run the demo2.py, it reported an AttributeError: module 'pybgs' has no attribute 'DPAdaptiveMedian', then I annotated that line and ran again, same error happened but for the following line: AttributeError: module 'pybgs' has no attribute 'DPGrimsonGMM'

demo2_1

However, if I removed the whole if is_cv2() or is_cv3() section, the program could be executed successfully

demo2_4

demo2_2

PC config.: Windows 10, Anaconda environment, Pycharm 2019.2.1, Visual studio 16 2019, OpenCV 3.4.2

I followed the https://github.com/andrewssobral/bgslibrary/wiki/Wrapper:-Python to install the pybgs whereas the installation details were slightly different, First I cloned this repository and added OpenCV_DIR system path, Next cmake ... BGS_PYTHON_SUPPORT=ON ... failed, So I wnet back to Building Python wrapper from scratch then used python setup.py build and python setup.py install as a result I saw the: -- The C compiler ... ... -- Configuring done -- Generating done -- Build files have been written to: ...

Therefore I utilized VS 16 2019 to build the bgslibrary.sln in .\bgslibrary\build\temp.win-amd64-3.7\Release, which generated a file named pybgs.cp37-win_amd64.pyd

Based on this .pyd file I can smoothly run demo.py and demo2.py (removed a part), but the installation procedure and partial file names were not exactly the same as the tutorial, in addition the error "AttributeError: module 'pybgs' has no attribute 'DPAdaptiveMedian'".

I hope to know how to fix that.

Sincerely,

Hi, It's been three years and I'm using the DPAdatptiveMedian method inside this package and I'm experiencing the same problem, have you solved this problem now? sincerely look forward to your reply!

LP308210365 avatar Jul 14 '22 10:07 LP308210365

Hello @Acxyle @LP308210365 , Sorry for my delayed feedback to you.

Unfortunately depending of the OpenCV version you have, only a few algorithms are available, here's an updated list: https://github.com/andrewssobral/bgslibrary/wiki/List-of-available-algorithms#list-of-the-algorithms-available-in-bgslibrary

For info, I just released a new version of the BGSLibrary, now v3.1.0. I fixed several issues concerning the different OpenCV versions. I tested it on Windows, Mac and Linux, both compiling the C++ library on OpenCV 3.4.7, 3.4.16 and 4.6.0. I also tested its respective Python wrapper and GT user interface.

Everything is working for me, could you please check in your side if this new version fix your issues? Thanks in advance, Andrews

andrewssobral avatar Jul 24 '22 22:07 andrewssobral