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

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

Open
Acxyle opened this issue Oct 23, 2019 · 4 comments
Open

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

Acxyle opened this issue Oct 23, 2019 · 4 comments

Comments

@Acxyle
Copy link

Acxyle commented Oct 23, 2019

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,

@andrewssobral
Copy link
Owner

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

@andrewssobral andrewssobral pinned this issue Oct 23, 2019
@Acxyle
Copy link
Author

Acxyle commented Oct 25, 2019

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.

@LP308210365
Copy link

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!

@andrewssobral
Copy link
Owner

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

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

No branches or pull requests

3 participants